How to Find Large Files by Size in Ubuntu Linux

The Storage Crisis

When an Ubuntu server runs completely out of hard drive space, the entire system can crash, preventing databases from writing new entries and taking web applications offline. In a panic, you need to instantly identify the massive files (like runaway log files, old database dumps, or forgotten ISO images) that are hogging the storage so you can delete them. You cannot use the ls command to do this efficiently across thousands of folders. You must instruct the Linux kernel to search the filesystem purely mathematically, based strictly on file size.

Using the find Command with -size

The Linux find command utilizes the -size flag to filter the filesystem based on precise megabyte or gigabyte measurements.

  1. Open your Terminal application (Ctrl + Alt + T) or log into your server via SSH.
  2. To search the entire server (/) for any file that is strictly larger than 1 Gigabyte, type the following command exactly:
  3. sudo find / -type f -size +1G
  4. Press Enter and provide your administrator password.

Refining the Search

The terminal will output a list of file paths for the massive files. The plus sign (+) is critical; it means “greater than.” You can modify the search parameters using different units:

  • Megabytes: find /var/log/ -type f -size +500M (Finds files larger than 500 Megabytes in the log folder).
  • Kilobytes: find ~/Documents/ -type f -size -10k (Using a minus sign finds files smaller than 10 Kilobytes).
  • Exact Size: find / -type f -size 100M (Removing the plus/minus sign searches for a file that is exactly 100 Megabytes).

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.