[SLE] ls * > bla gives me a lot of ^[[00m in bla
Hello, Since a couple of months I am my own system administrator so I started to learn some bash. I like to write a script that will as a result give me a file with n of the largest files on my /home partition. I like to use the outcome of "ls -lR *", but when I write this to file I get the above-mentioned unwanted ^[[00m before and after file-names. I found that on somebody-elses RedHat (using SuSE 6.3 myself) this is not the case. I would appreciate any hint pointing me towards something I should pay attention to. Thank you, Jorn PS Although I don't ask for such a script, if somebody has one I would still be interested, even if that would flatten my learning-curve. -- Jorn Verwey PSI Life Sciences WMSA/B14 CH 5232 Villigen PSI tel. +41 56 310 4246 -o) fax. +41 56 310 3132 /\\ Jorn.Verwey@psi.ch _\_v -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Hi, On Mon, May 29 2000 at 12:43 +0200, Jorn Verwey wrote:
Since a couple of months I am my own system administrator so I started to learn some bash. I like to write a script that will as a result give me a file with n of the largest files on my /home partition. I like to use the outcome of "ls -lR *", but when I write this to file I get the above-mentioned unwanted ^[[00m before and after file-names. I found that on somebody-elses RedHat (using SuSE 6.3 myself) this is not the case.
When ls is invoked with the --color=yes option it will use escape sequences like ^[[00m to produce coloured output. Either use --color=no to turn it off or --color=tty to only use coloured output when you're not redirecting output (IIRC --color=tty is standard on SuSE Linux).
PS Although I don't ask for such a script, if somebody has one I would still be interested, even if that would flatten my learning-curve.
find /home -type f -printf "%s\t%p\n" |sort -rn |head -n20 |less Ciao, Stefan -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (2)
-
jorn.verwey@psi.ch
-
stefan.troeger@wirtschaft.tu-chemnitz.de