I'd like to determine what process has ownership of a lock-file. The lock-files are simply a file with a specific name that has been created.
So, how can I determine what process has a particular file open in Linux? Preferably a one-liner type or a particular Linux tool solution would be optimal.
Answer
You can also use fuser
for this:
~> less .vimrc
# put in background
~> fuser .vimrc
.vimrc: 28135
~> ps 28135
PID TTY STAT TIME COMMAND
28135 pts/36 T 0:00 less .vimrc
No comments:
Post a Comment