How do you find out which processes have a lock on a given file, in Linux?


In addition to lslk, you could also try lsof.

| improve this answer | |

Try fuser

In the example below, I have run fuser against a jar file and it has shown me the pids for the processes using the jar.

$ fuser app.jar

app.jar:    15529m   26293m   23017m
| improve this answer | |

You try lslk?

| improve this answer | |
  • lslk is old stuff; for example, it does not appear anymore in newer releases of RHEL than 3. – wzzrd Oct 5 '09 at 11:13
  • Yeah, lsof was what I was thinking of. But it was already on my Debian Etch box, so go figure. – user17642 Oct 5 '09 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.