How can I see which processes locked a file?

Solution 1:

In addition to lslk, you could also try lsof.

Solution 2:

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