Find the largest files and folders on Linux
Rank the 20 biggest items under the current directory by disk usage.
cd into the directory you want to scan and run the command below. The 20 largest files and folders are listed, largest first.
01Command
Command
$ du -ahx . | sort -rh | head -2002What it does
du -ahx estimates usage for every file (-a), human-readable (-h), staying on one filesystem (-x) so mounted volumes are skipped. sort -rh sorts human-readable numbers in reverse, and head -20 keeps the top of the list.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- du(1) — estimate file space usageEvidence: du -a lists all files; -x stays on one filesystem; combined with sort -rh shows largest first.
Last verified: 2025-11-21 · Category: Files & Folders