in reply to piglist

Nice little script. I can see using this on some of the Windows/NAS servers at my office; but, in *nix land I'll almost always do
find /usr/local -type d | xargs du -s
Which gives
6784 /usr/local 88 /usr/local/bin 24 /usr/local/OpenSourceLicenses 8 /usr/local/OpenSourceVersions 6664 /usr/local/share 6664 /usr/local/share/man 200 /usr/local/share/man/man1 6464 /usr/local/share/man/man3

You might want to think about giving an option to mimic this minimal, data only output so it'd be easy to pipe the output into another script or program and not have to weed out ---- and version lines. Maybe two options, one for the version of the program (instead of outputing it by default, -version) and one for pretty formatting (-pretty-print maybe?). Just a thought. Good work, though.

---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.

Replies are listed 'Best First'.
Re^2: piglist
by hsinclai (Deacon) on Nov 17, 2007 at 02:43 UTC
    ooh good suggestion for having "bare" output .. yeah

    Note though my script sorts the list in proper order (not by just the leading number), so the output is nicer than what  find /dir -type d | xargs du -s |sort gives ya.

    Thanks! Harold

      (If I guessed correctly given your reply & code then ...) Ah, but one would use the number sorting option ...

      du ... | sort -k1,1n [-k2]

      You could get the same effect by using find /dir -type d | xargs du -s | sort -n.


      We're not surrounded, we're in a target-rich environment!