• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1610
  • Last Modified:

How to find what process is locking a file.

In HP-UX, when I tried to delete a certain file, the system complained that this file is currently used. I am wondering if there is a utility which could tell me which process was locking the file. On http://www.sysinternals.com/linux/utilities.shtml, there is a tool called Filemon doing what I want. But it's unavailable under HP-UX platform. I don't mind compiling the source to get it run under my OS.
0
xingdongjin
Asked:
xingdongjin
1 Solution
 
glassdCommented:
Try looking lsof. We use it on Solaris and it is very useful.

http://freshmeat.net/projects/lsof/
0
 
shivsaCommented:
There is a standard unix commands called fuser.
it will tell u which process is locking the file.

man fuser.

also if u can get lsof, it works the same.
0
 
gheistCommented:
some systems call it fstat or pstat. lsof is more complete sometimes.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now