How to Find the Largest Files in Linux
The search for large files is especially relevant when the disk runs out of space and you have to look for files to delete. The best way to find all the largest files on a Linux server is to use the command line. You can easily get a list of the largest files using a combination of several simple commands.
How to Find the Largest Files in Linux:
Sometimes you can search for large files, especially large log files that can quickly fill your server, with the following command you can find the top 10 largest files on the server:
# find / -type f -exec du -sh {} 2>/dev/null + | sort -rh | head -n 10

The output should show you the largest files:
487M /home/largefile3
345M /home/largefile2
211M /home/largefile1
123M /odoo/odoo-server/.git/objects/pack/pack-dcf71f4c259beb1fgt56е3b4a00a45e1f2a8382.pack
123M /backup/odoo/odoo-server/.git/objects/pack/pack-dcвdd1f4c259beb35445666аb4a00a45e1f2a8382.pack
98M /var/lib/mongodb/journal/WiredTigerPreplog.0000000002
197M /var/lib/mongodb/journal/WiredTigerPreplog.0000000001
100M /backup/var/lib/mongodb/journal/WiredTigerPreplog.0000000002
100M /backup/var/lib/mongodb/journal/WiredTigerPreplog.0000000001
66M /var/lib/mysql/ibdata1
How to Find the Largest Files with a specific extension in Linux:
If you are looking for large files with a specific extension, you can find the top 10 largest files by their extension using the following command, we will use the “deb” extension in this case.
# find / -type f -iname "*.deb" -exec du -sh {} + | sort -rh | head -10

The output should show you the largest files containing the specified extension:
30M /var/cache/apt/archives/mongodb-org-tools_3.2.14_amd64.deb
30M /backup/var/cache/apt/archives/mongodb-org-tools_3.2.14_amd64.deb
26M /var/cache/apt/archives/libpython2.7-dev_2.7.12-1ubuntu0~16.04.1_amd64.deb
26M /backup/var/cache/apt/archives/libpython2.7-dev_2.7.12-1ubuntu0~16.04.1_amd64.deb
13M /opt/wkhtmltox-0.12.1_linux-trusty-amd64.deb
13M /backup/opt/wkhtmltox-0.12.1_linux-trusty-amd64.deb
9.5M /var/cache/apt/archives/mongodb-org-server_3.2.14_amd64.deb
9.5M /backup/var/cache/apt/archives/mongodb-org-server_3.2.14_amd64.deb
7.9M /var/cache/apt/archives/g++-5_5.4.0-6ubuntu1~16.04.4_amd64.deb
7.9M /backup/var/cache/apt/archives/g++-5_5.4.0-6ubuntu1~16.04.4_amd64.deb