Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Quit staring at confusing du output when the disk is full
đź§© The Challenge
You get the alert that a partition is at 98% and you run du -sh * just to be met with a wall of text that makes your eyes bleed. Most of the time you’re just guessing which folder is actually bloated.
đź’ˇ The Fix
Use the –max-depth flag paired with sort to cut through the noise instantly. It isolates the top-level offenders so you can stop clicking into subdirectories like a chump.
du -ahx --max-depth=1 /var/log | sort -hr | head -n 10
⚙️ Why It Works
Adding the -x flag keeps you from accidentally diving into mounted filesystems, while sorting by human-readable numeric values puts the actual problems right at the top.
🚀 Pro-Tip: Pipe it into awk if you just want the list of paths without the file sizes cluttering up your terminal.
Linux Tips & Tricks | © ngelinux.com | 8/15/2026
