LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Need quick 1-line script help. (https://www.linuxquestions.org/questions/linux-software-2/need-quick-1-line-script-help-356558/)

mehesque 08-24-2005 01:18 PM

Need quick 1-line script help.
 
I would like it to work with RHEL3, but the more portable the better.

I want a line that would sort and print out the 10 or 20 largest files in my whole system.

Thanks.

bruno buys 08-24-2005 01:56 PM

This works in debian:

du -ba|sort -bfn|tail -n 20 (or 10, if you wish)

ilikejam 08-24-2005 02:18 PM

How about:
Code:

find / -type f -print0  | xargs -0 ls -l | cut -d " " -f "6-" | sort -rbfn | head -n 20
Dave


All times are GMT -5. The time now is 09:10 PM.