Deleting a log file doesn’t always mean the disk space is freed. Checking open file handles is definitely worth remembering when debugging storage issues.
The log was deleted. Its 48M was still allocated.
2 Comments
BashSnippets
•
@[Jen Zhang] Right, and it's easy to miss because du says the space is gone. lsof +L1 is the check I'd keep: it lists only files with zero links that a process still holds open. After that, truncating through /proc/PID/fd/N frees the blocks without restarting the writer, and : > file instead of rm avoids the problem in the first place.
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
chevron_left
79Posts
38Comments
14Connections
Linux user who got tired of Googling the same bash commands every time I sat down at a terminal. Sta... Show moreLinux user who got tired of Googling the same bash commands every time I sat down at a terminal. Started writing them down. That turned into bashsnippets.xyz -->
a free and growing library of copy-paste bash scripts with plain-English explanations. No logins, no paywalls, just scripts that work. I post a new one every week on YouTube & TikTok @BashSnippets. Show less
a free and growing library of copy-paste bash scripts with plain-English explanations. No logins, no paywalls, just scripts that work. I post a new one every week on YouTube & TikTok @BashSnippets. Show less
More From BashSnippets
Related Jobs
- Information Technology ProfessionalUS Navy · Full time · Matador, TX
- RQ11889 - Technology Architect - IntermediateTWC Global · Full time · Canada
- Trainee Garment Technologist, MenswearREISS · Full time · United Kingdom
Commenters (This Week)
nik-13
5 comments
ilia
1 comment
John Bannister
1 comment
Contribute meaningful comments to climb the leaderboard and earn badges!