How to find large files in Linux

Filesystem alert! We all hate to get full-filesystem alerts, especially at quitting time on Friday when the developers are trying to meet a deadline. The usual culprit is one or more large files that were just created, compiled, or loaded. Determining the definition of a large file varies by system environment, but a “large” file can fill up a filesystem quickly, especially in a large database or development environment. To find the files that quickly fill up a filesystem and/or other large files, we need a flexible tool that will search for files larger than a user-defined value. The find command is your friend when a filesystem search is needed.

To find a file larger than 2GB use the following command:

# find /var/log -type f -size +2G -exec ls -lah {} \;
-rw-r--r--. 1 root root 3.0G Jan  7  2015 /var/log/file01

The above will find files larger than 2 GB in the /var/log folder, you can just specify / to search for large files in the root or specify any other mount point.

Similarly to find files larger than 500MB use:

# find /var/log -type f -size +500M -exec ls -lah {} \;

The -type f option only searches for file in the specified directory.