Find The Largest Files

Tips of Linux

du

$ sudo du -ah / | sort -rh | head -n 9

This command will show the 9 biggest files on your system, sorted by size. The “du -ah /” part of the command tells “du” to show the size of all files and directories starting from the root directory (“/”). The “sort -rh” part of the command sorts the output in reverse numerical order, so the largest files appear at the top.

$ sudo du -h -d 2|grep [GT] |sort -nr
$ sudo du -h --max-depth=2|grep [GT] |sort -nr
$ sudo du -h / --max-depth=1 | sort -hr | head -n 9
$ du -sh
$ du -lh --max-depth=3
$ du -sh * | sort -n
$ du -sk *.mkv

find

$ sudo find $HOME -type f -printf '%s %p\n' | sort -nr | head -9
$ sudo find / -type f -size +1G -exec du -h {} \;
comments powered by Disqus