↑ ↓ select, Enter open, Esc close

Find the largest files in a directory

Adjust the values, the command updates live
user@server
find /var/www/vhosts -type f -size +500M -exec ls -lh {} + 2>/dev/null | sort -k5 -rh | head -20

Lists the 20 largest files above a minimum size. Useful when a disk is filling up and you need to know quickly what is taking up the space. Permission errors are hidden.

Note: On large directory trees this can take several minutes. Prefix it with sudo to include files owned by other users.

Also searched as

  • find all files larger than 500 MB
  • what is using my disk space
  • search for large files linux

Related one-liners

All in Filesystem

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.