↑ ↓ select, Enter open, Esc close

Find the largest log files on the server

Adjust the values, the command updates live
root@server
du -ah /var/log 2>/dev/null | sort -rh | head -20

Determines the size of all files and subdirectories in the log directory and shows the 20 largest entries. Directories appear with their total size, so a bloated /var/log/journal or an application log that is never rotated stands out immediately. For the logs of all Plesk domains, use /var/www/vhosts/system as the path.

Note: A log that is not rotated needs an entry under /etc/logrotate.d/. Do not delete a file that is still being written to with rm, empty it with truncate -s 0 instead.

Also searched as

  • logs filling up disk
  • which log file is so big
  • var log is full
  • find large log files linux

Related one-liners

All in Logs

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.