или так
1. Finding largest directories and files in Linux
First we are going to look at how we can find the largest directories and files in linux combined, execute the following command to find the top 10 largest directories and files on your Linux server:
# du -ah /* 2>/dev/null | sort -rh | head -n 10
2. Finding the top largest directories in Linux
This command can be pretty useful when you need to check the size of the directories in the root partition to get an idea of how the used space on your server is distributed, using the following command you can find the top 10 largest directories in the root partition:
# du -sh /*/ 2>/dev/null | sort -rh | head -n 10
You can also use the following command to check the size of the sub-directories of a given directory, in this case we’ll use the directory ‘var’:
# find /var/* -type d -exec du -sh {} 2>/dev/null + | sort -rh | head -n 10
3. Finding the top largest files in Linux
Sometimes you may want to look for large files, especially large log files that can fill up your server pretty quickly, using the following command you can find the top 10 largest files on your server:
# find / -type f -exec du -sh {} 2>/dev/null + | sort -rh | head -n 10
If you are looking for large files of a particular extension you can find the top 10 largest files by their extension with the following command, we are going to use the ‘deb’ extension in this case:
# find / -type f -iname "*.deb" -exec du -sh {} + | sort -rh | head -10