__/ [ [H]omer ] on Monday 22 January 2007 02:22 \__
> Looking to cull some lint off the file server, I did the following:
>
> du -sh $(du -s /shared/* | sort -rn | sed -e "s/^[0-9]* *//")
>
> Which gives a nice sorted output along the lines of:
>
> 26G /shared/stuff1
> 25G /shared/stuff2
> 22G /shared/stuff3
> 11G /shared/stuff4
> 9.7G /shared/stuff5
> 6.7G /shared/stuff6
>
> Etc.
>
> (For those who think that's a bit convoluted, it's actually necessary
> because "sort" thinks that 12K > 11G. Anyway ...)
>
> Oh, that's handy, I thought. Let's make an alias:
>
> alias du='du -sh $(du -s $1 | sort -rn | sed -e "s/^[0-9]* *//")'
> Hint: ^^ (What's wrong with this picture?)
>
> Then I ran:
>
> du /shared/*
>
> Seconds later ... I went from around 140 processes, to over 7 thousand.
du -sh $(du -sh $(du -sh $(du -sh $(du -sh $(du -sh $(du -s $1 | sort -rn |
sed -e "s/^[0-9]* *//") -s $1 | sort -rn | sed -e "s/^[0-9]* *//") -s $1 |
sort -rn | sed -e "s/^[0-9]* *//") -s $1 | sort -rn | sed -e "s/^[0-9]*
*//") -s $1 | sort -rn | sed -e "s/^[0-9]* *//") -s $1 | sort -rn | sed -e
"s/^[0-9]* *//")
Was it at least nice'd? Did you have to escape to a different virtual
terminal? killall du?
> Oops.
> (Time for a pint of coffee, methinks.)
alias coffee='make_coffee(coffee) | add(sugar)'
Make that a gallon of coffee.
> Well, at least the WiNuTs can't criticize my load average any more. :)
0 9 * * * reboot
0 9 5,10,15,20,25,28 * * defrag.exe
0 9 1,10,20 * * scandisk.exe
0 9 1,7,14,21,28 * * mcafee.exe \runscan
noob@billybox:C:\> uptime
9:32am up 1 day 1:47, 1 user, load average: 15.46, 21.49, 16.39
--
~~ Best wishes
Roy S. Schestowitz | "Ping this IP, see if it responds the second time"
http://Schestowitz.com | RHAT Linux | PGP-Key: 0x74572E8E
7:20am up 95 days 17:34, 7 users, load average: 0.26, 0.19, 0.19
http://iuron.com - Open Source knowledge engine project
|
|