Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 6 down vote accepted

In addition to lslk, you could also try lsof.

share|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
share|improve this answer

You try lslk?

share|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. –  emgee Oct 5 '09 at 15:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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