How to find the biggest files on disk in seconds (on Linux)

Well, sometimes we need to quickly find some really big files on disk, regardless of directory, or file system, or name. Like hundreds of megabytes in one single file. These files are not so common on a regular Linux so it’s quite OK to just have them displayed in console – there will be only a few anyway.

That’s pretty simple to do with the following command:

find / -type f -size +200M -exec ls -l {} \;

This will display all files with size bigger than 200 megabytes, in the entire file system.

To search only in homes directory simply add it in command:

find /home/ -type f -size +200M -exec ls -l {} \;

Or to search only for files bigger than 500 megabytes use this one:

find / -type f -size +500M -exec ls -l {} \;

In order to exclude some paths from searching large files into, there’s the “! -path ‘/excluded/*’” option that can be used like this to exclude everything in /home/ and .proc/ directories:

find / ! -path '/home/*' ! -path '/proc/*' -type f -size +100M -exec ls -l {} \;

Beware of the “files” in /proc file system, these could be reported big, but … nope, they’re not really files, nothing to worry. More details about these here.

Leave a Reply