[olug] Speaking at Infotec April 14-15, 2009

Dan Linder dan at linder.org
Wed Apr 1 13:42:38 UTC 2009


On Tue, Mar 31, 2009 at 5:01 PM, David Walker <olug at grax.com> wrote:

> I generally use "du -shx *", which is easier to read but harder to sort.
> Some of my older and smaller drives have mount points several levels
> down for one reason or another and the "x" keeps the search restricted
> to a single file system.
>

This is getting a little off track from Adam's original question, but I like
using something like this:

du -skx * | sort -n |  commas

Where the script "commas" is a custom one-liner script:
/usr/bin/perl -pe 's/(?<=\d)(?=(?:\d\d\d)+\b)/,/g'

This keeps the data sortable, but adds commas to make the numbers more
human-readable.

dan at titan:~$ du -skx * | sort -rn  | head -7 |/usr/bin/perl -pe
's/(?<=\d)(?=(?:\d\d\d)+\b)/,/g'
269,451,108     Documents
70,986,560      tmp
38,821,412      FinalFrontier
17,758,380      Backups
3,532,404       enav_repo
1,629,932       Music
1,286,724       xen_system1.img

Just my $0.005...  (Dang economy...)

Dan

-- 
"Quis custodiet ipsos custodes?" (Who can watch the watchmen?) -- from the
Satires of Juvenal
"I do not fear computers, I fear the lack of them." -- Isaac Asimov (Author)
** *** ***** ******* *********** *************



More information about the OLUG mailing list