Linux Commands / IT Support Guides
Find growing directories with du
Use du to see which subdirectories use the most disk space before deciding where to investigate.
Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution
Understand the problem
Choose one directory on the affected filesystem. The command reads directory entries and can take time if there are many files.
Run the command
Run the example for /var/log or replace it with the directory you want to inspect. The -x option keeps the scan on that filesystem, -h adds readable units, and --max-depth=1 limits the displayed totals to one level below the starting directory.
du -x -h --max-depth=1 /var/log
Read the output
A line such as 240M /var/log/journal is the total for that subdirectory. The line ending in /var/log is the total for the whole starting directory, so it already includes journal.
Choose the next step
Run the same command with the largest relevant subdirectory as the starting point. If the command reports Permission denied, treat the totals as incomplete.
Before making changes
Before cleanup, check who owns the files and how long they must be kept. A deleted file can still use disk space while a process holds it open, which can help explain a difference between du and df.