[chiglug] fyi: list top 10 largest open files

Drew Fustini pdp7pdp7 at gmail.com
Mon Jan 4 23:57:37 UTC 2016


nice, thanks!

On Mon, Jan 4, 2016 at 5:52 PM, Freddy Martinez
<freddymartinez9 at gmail.com> wrote:
> Often I find myself sorting disk use using du -sh * but it doesn't properly
> handle Mb, Gb, Kb for historical reasons.  So there is an alias I use often
> called duf
>
> alias duf='du -sk * | sort -n | while read size fname; do for unit in k M G
> T P E Z Y; do if [ $size -lt 1024 ]; then echo -e
> "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done'
>
> Try it out.
>
>
>
> On Mon, Jan 4, 2016 at 5:45 PM, Drew Fustini <pdp7pdp7 at gmail.com> wrote:
>>
>> I thought this was nifty:
>> https://plus.google.com/+CybercitiBiz/posts/M35xwuzfvcM
>>
>> Want to list top 10 largest open files on a Linux or Unix like system?
>> Try:
>> lsof / | awk '{ if($7 > 1048576) print $7/1048576 "MB" " " $9 " " $1
>> }' | sort -n -u | tail
>>
>> _______________________________________________
>> discuss mailing list
>> discuss at lists.chicagolug.org
>> https://lists.chicagolug.org/mailman/listinfo/discuss
>
>
>
>
> --
> Freddy Martinez




More information about the discuss mailing list