How to Find Large Files in Linux

How to Find Large Files in Linux and Free Up Disk Space. Running out of disk space on a Linux system is a common problem, especially after installing software, running backups, or storing large media files. Keeping track of which files and directories consume the most space makes cleanup much easier and helps prevent unexpected storage issues.

Below are several reliable and efficient ways to locate large files in Linux using built in command line tools. These methods work on virtually all modern Linux distributions.

Finding Largest Files in Linux

find largest files in linux
Find largest files in Linux to Clean up Disk Space

List Files by Size in Linux

List Files by Size Linux - finding largest files - clean up disk space

To list files in the current directory sorted by size, largest first:

ls -Ssh

Flag breakdown:

  • -S sorts by file size
  • -s shows allocated size
  • -h outputs human readable sizes

This is useful for a quick look but only applies to the current directory.

Find Large Files Using the find Command

To locate files larger than a specific size recursively:

  1. Open a terminal with Ctrl + Alt + T
  2. Navigate to the directory you want to scan:
cd /path/to/start
  1. Run the following command:
find . -type f -size +100G

This searches for:

  • Regular files only (-type f)
  • Files larger than 100 GB (-size +100G)
  • Starting from the current directory (.)

You can change the size threshold to values like +500M, +1G, or +10G.

Safely Preview Large Files Before Deleting

Before deleting anything, it is a good idea to preview what will be affected:

find . -type f -size +100G -exec ls -lh {} +

This lists the matching files along with sizes so you can verify them.

Remove Large Files in Linux

Warning: This permanently deletes files. There is no undo.

find . -type f -size +100G -exec rm {} +

The -exec rm {} + portion deletes the matched files in efficient batches.

If you want confirmation before each deletion, use:

find . -type f -size +100G -exec rm -i {} \;

Find the Largest Files Using find, du, sort, and head

This method is ideal when you want a ranked list of the largest files:

  1. Change to your desired base directory.
  2. Run:
find . -type f -exec du -h {} + | sort -hr | head -8

find large files in linux

This command chain does the following:

  • find locates all files
  • du -h measures disk usage
  • sort -hr sorts largest to smallest
  • head -8 displays the top eight results

Find Large Directories Instead of Files

Sometimes directories consume more space than individual files. To find the largest directories:

du -h --max-depth=1 | sort -hr

This shows disk usage per directory one level deep.

Common Permission Warnings

You may see messages such as Permission denied when scanning system directories. This is normal for non root users.

To suppress warnings:

find . -type f -size +1G 2>/dev/null

Summary

Finding large files in Linux is straightforward once you know the right commands. Whether you are diagnosing a full disk, cleaning up backups, or managing server storage, these tools give you clear visibility into what is consuming space.

Regular disk usage checks can prevent outages, improve performance, and keep your system clean and manageable.

Once you know where the space is going, cleanup becomes fast and painless making it easy to free up disk space.