[PLUG] List ten biggest files with du

Fred James fredjame at fredjame.cnc.net
Mon Oct 13 20:54:52 UTC 2008


chris (fool) mccraw wrote:
> On Mon, Oct 13, 2008 at 13:24, John Jason Jordan <johnxj at comcast.net> wrote:
>   
>> This ought to be a piece of cake, but I can't get it to work.
>>
>> First I tried various things in the ls command, but the man page didn't help much and I failed.
>>
>> Google turned up some suggestions, including du. After reading man du and further googling I got this far:
>>
>> jjj at Devil7:~$ du -a -h ~/ | sort -n -r | head -n 10
>> 1020K   /home/jjj/Software/Adobe/Reader8/Reader/intellinux/lib/libAXSLE.so
>> 1020K   /home/jjj/software/Adobe/Reader8/Reader/intellinux/lib/libAXSLE.so
>> 1020K   /home/jjj/Phonetics/image24.wav
>> 1020K   /home/jjj/Desktop/compat-wireless-2008-04-08/drivers/net/wireless/ath5k/ath5k.o
>> 1016K   /home/jjj/Desktop/sodipodi-0.34-CVS.amd64.rpm
>> 1012K   /home/jjj/Software/sK1-0.9.0/src/extentions
>> 1012K   /home/jjj/Phonetics/LadefogedCD/coursecdfolder/course/chapter4/Bsounds/bruce42column2.aiff
>> 1012K   /home/jjj/.openoffice.org2/user/uno_packages/cache/uno_packages/gGjaXg_/sun-report-builder.oxt/liblayout-0.2.6.jar
>> 1008K   /home/jjj/REPI/InDesign/WA_Fund_Text/Impact of Licensing Requirements.doc
>> 1008K   /home/jjj/Phonetics/Vowels&ConsonantsCD/vowels/chapter6/consonants1.aiff
>>
>> I'm not sure why it shows files of 1 MB as the largest files in ~/. There are several files over 100 MB in there.
>>
>> Are there any du experts in here?
>>     
>
> hmm, i wouldn't use du to do it, but i think the root of your problem
> is that you're using the "-h" flag which flubs the sorting-by-number
> system up, since 1008K > 100M when you start letting computers sort
> naively.
>
> i'd probably do find . -type f -size +50M -exec ls -l {} \; |sort -r
> -n -k +5 | head
>
>   
All
'du -ak | sort -nr | head -10' may be something like what you are 
looking for.
Regards
Fred James




More information about the PLUG mailing list