When Linux storage is running low, locating large files gives you paths to inspect. The find command searches a chosen directory for files above a size threshold.
This article shows how to set that threshold and rank matching files by apparent size. It also explains when du helps compare directory usage.
TL;DR: Find large files in Linux
Use find with a size predicate to locate regular files, then sort the results if you need a ranked list.
find /home -type f -size +500M -print
- Replace /home with the directory you want to inspect.
- Change +500M to set a different threshold.
- Use du when you need allocated disk usage for directories rather than a file-length search.
What does finding large files mean?
Apparent size is the logical length reported for a file. Disk usage estimates filesystem space consumed, and sparse files can have a larger logical length than their allocated blocks.
The + sign means at least the given number of units. In GNU find, M means 1024 × 1024 bytes, and size values are rounded up before comparison. For a byte threshold, use the c suffix, such as -size +524288000c for 500 MiB.
For related command details, see the LinuxForDevices guides to find and du.
How to find and rank large files step by step
Choose a starting directory and filter regular files by size. Add sorting when a ranked list helps decide what to inspect first.
Step 1: Search one directory above a threshold
Start with the directory you want to examine. This example searches /home for files larger than 500 MiB and prints each matching path.
find /home -type f -size +500M -print
Set the starting path to the current directory by using dot instead of /home. The -type f test excludes directories. The -print action writes matching paths to standard output.
Step 2: Search the root filesystem when needed
Add -xdev when the search should stay on one filesystem. Leave it out when other mounted filesystems should be included.
find / -xdev -type f -size +1G -print 2>/dev/null
The redirection hides permission and traversal errors, including evidence of skipped paths. Run the command as your ordinary user first. If access is required, choose a narrow path and use your system’s approved privilege method.
Step 3: Rank files by apparent size
For a ranked list, print each file’s byte length and path, then sort numerically in descending order. This GNU find format avoids splitting paths at spaces because sort receives each complete output line.
find /home -type f -printf '%s\t%p\n' | sort -nr | head -n 10
The first column is bytes, so -n compares numeric values and -r places larger values first. This command depends on GNU find’s -printf extension, which may be missing from other find implementations.
The newline-separated format handles spaces in paths but not newline characters inside filenames. Use NUL-delimited input and compatible tools for scripts that accept arbitrary names. For human-readable ranking, see sorting files by size in Linux and the Coreutils manual for sort.
Step 4: Compare directory usage
Use du to compare directory totals when the question is which part of a tree consumes space. The -a option includes files, -x keeps traversal on one filesystem, and -h prints readable units in multiples of 1024.
du -ahx /home 2>/dev/null | sort -h | tail -n 10
This ranks files and directories by reported disk usage. Directory totals include entries below them, so parent and child rows overlap.
What should you check before acting on large files?
Check the path, owner, purpose, and whether the search covered the filesystem you intended before moving or removing anything.
| Case | What to know | Next check |
|---|---|---|
| Permission denied | Some paths may be unreadable because of permissions. | Run a scoped search with suitable access. |
| Separate mount | -xdev excludes other filesystems. | Search each mount explicitly if it belongs in the audit. |
| Odd filenames | Spaces and newlines complicate pipelines that split on whitespace. | Use NUL-delimited output and compatible tools for robust automation. |
| Sparse file | Logical length can exceed allocated space. | Compare apparent size with du’s reported usage. |
| Old modification time | Age alone does not show that a file is safe to remove. | Identify the owning application or user before cleanup. |
For a disk-space overview, compare the result with the df command’s filesystem totals.
find /home -type f -mtime +100 -size +100M -print
This optional filter requires both an old data modification time and a size above the selected threshold. It does not identify whether an application still needs the path.
Conclusion: Inspect before removing files
Treat search results as an inventory for follow-up, not a cleanup instruction.
See the GNU Findutils manual, the GNU Coreutils manual, and our man command guide.
FAQ
These answers cover common threshold and scope questions.
How do I find files larger than a specific size in Linux?
Use find /path -type f -size +500M -print and replace /path and 500M with your directory and threshold. The M unit is a mebibyte in GNU find.
How do I find the largest files in a directory?
Use GNU find to print byte sizes and paths, then sort numerically in reverse order: find /path -type f -printf ‘%s\t%p\n’ | sort -nr | head -n 10.
Does find -size show disk space used?
The GNU find size test uses apparent file length. Use du when you need an estimate of filesystem space used, and note that sparse files can differ.
