Site icon New Generation Enterprise Linux

Stop relying on du to find your massive hidden log files

Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)

Stop relying on du to find your massive hidden log files

đź§© The Challenge

You get the dreaded disk full alert at 3 AM and spend an hour running du recursively, only to find the culprit was a deleted log file still held open by a process. It’s a total waste of time because the filesystem doesn’t reclaim that space until the process lets go.

đź’ˇ The Fix

Use lsof to spot those ghost files that are clogging up your disk even though they technically don’t exist on the directory tree anymore. This saves you from hunting through directories when the problem is just a stuck daemon.

lsof +L1

⚙️ Why It Works

Adding that +L1 flag tells the tool to list all open files that have a link count of less than one, which is exactly how you catch these phantom storage hogs. You’ll usually see a PID next to the filename, so just restart the service and watch your df output finally breathe again.

🚀 Pro-Tip: If you’re on a super old distro that hates that flag, filter the output for “(deleted)” to get the same result.

Linux Tips & Tricks | © ngelinux.com | 10/6/2026

0 0 votes
Article Rating
Exit mobile version