I have many files in a directory on Linux. How to find top K largest files in a directory?
我在Linux的目录中有很多文件 。 如何在目录中找到前K个最大的文件?
For example, find top 10 (K=10) large files in the current directory:
例如,在当前目录中找到前10个(K = 10)大文件:
du -h --max-depth 1 * | sort -rh | head -n 10
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。
翻译自: https://www.systutorials.com/how-to-find-top-k-largest-files-in-a-directory-on-linux/