How do I find out what process has a lock on a file in Linux?

directory, file, filesystems, linux

Solution

Use lsof to find out what has what files are open.

man lsof or have a look here

Problem

Today I had the problem that I couldn't delete a folder because "it was busy". How can I find out which application to blame for that or can I just delete it with brute force?

Original source