On 11/16/2006 7:01 PM, Todd Walton wrote:
On 11/16/06, Karl Cunningham <[EMAIL PROTECTED]> wrote:
I'd like to take the output of
du --max-depth=0 *
and have it sorted by the number of bytes and add colors to distinguish
directories from files.
If you want to see information for all files and folders in the
current folder, then `du -ckxs * |sort -rn |head -n 11` will get you
sorted by bytes. Tweak as necessary, of course. (Tip: alias that
command to "ducks", courtesy of Linux Server Hacks.) I'm not sure
how'd you color it from a single command line. Would a shell script
be okay?
Sure, a shell (|| python || perl) script would work fine. This is one of
those where I figured I could learn at the same time as doing something
slightly useful.
My thought for color was to use sed to substitute the output of
`ls --color=...` for the file and directory names, but I don't know if
sed can substitute the output of a shell command.
Thanks.
Karl
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list