Killing a file handled process

You may have faced the problem which a dead/unreferenced process is holding a file descriptor to a file, so that you cant delete it using rm command, and giving an error message like below:


Cannot delete folder with rm -rf. Error: device or resource busy


Here what you have to do is to identify the process been hanged and kill it.

lsof +D

this will give you a list of process which are accessing files in the given folder.

kill that session using:

kill

if you still couldn't kill it use below.

kill -s SEGV


'via Blog this'

Comments

  1. This is a very practical topic! Handling file processes efficiently is something every system administrator and developer encounters. The techniques you've shared for identifying and managing processes are essential knowledge for maintaining stable systems.

    Effective process management is a fundamental skill in modern IT operations. Many professionals are enhancing their capabilities through structured training. DevOps training with placement Electronic City Bangalore provides comprehensive coverage of system administration, automation, and monitoring. Understanding process lifecycle management is crucial for both development and operations teams in today's fast-paced environments.

    ReplyDelete

Post a Comment

Popular posts from this blog

SSL certification of you web site

Running Local LLMs for Cursor IDE: A Quick Guide to Ollama Integration

Installing MPICH2 on Ubuntu