How to Find Large Files in Linux
Locate large files without crossing into other mounted filesystems.
find can filter files by type and size. Use -xdev to keep the scan on one filesystem.
Step by step
1 Find large files
$ find / -xdev -type f -size +500M -print 2>/dev/null Searches regular files above 500 MB and hides permission errors.
2 Show readable sizes
$ find / -xdev -type f -size +500M -exec ls -lh {} + 2>/dev/null ls -lh adds familiar units.
3 Narrow the search
$ find /var/log -type f -size +100M -exec ls -lh {} + A smaller starting path is faster and usually more useful.
Tips worth knowing
- Use du for directory usage.
- Use `lsof +L1` for deleted-but-open files.
- Narrow the search path whenever possible.
Frequently asked questions
How do I find files larger than 1 GB?
Use `find / -xdev -type f -size +1G` with an appropriate starting path.
Why do I see permission denied?
Some directories are not readable by your user; use appropriate privileges or suppress stderr.
If it goes wrong
The commands behind it
Locate files anywhere in a directory tree by name, type, size, date — and act on them.
df & duSee free space per filesystem and find what is eating your disk, directory by directory.
Concepts involved: Inode · Mount
More how-to guides
See how much space is left, and find out what is using it.
Extract a .tar.gz archiveUnpack tar.gz, tar.bz2, tar.xz and zip archives from the command line.
Free a port that is already in useFind which process holds a port and stop it cleanly.
Find and replace text in filesReplace text in one file or across a whole project, safely.