How to find top K largest files in a directory on Linux?

I have many files in a directory on Linux. How to find top K largest files in a directory?

asked Mar 5, 2014 by Eric Z Ma (44,280 points)

1 Answer

 
Best answer

For example, find top 10 (K=10) large files in the current directory:

du -h --max-depth 1 * | sort -rh | head -n 10
answered Mar 5, 2014 by Eric Z Ma (44,280 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...