Solved

How to find what process is locking a file.

Posted on 2003-10-23
3
1,598 Views
Last Modified: 2013-12-06
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
Comment
Question by:xingdongjin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:glassd
ID: 9609573
Try looking lsof. We use it on Solaris and it is very useful.

http://freshmeat.net/projects/lsof/
0
 
LVL 24

Accepted Solution

by:
shivsa earned 50 total points
ID: 9610205
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
 
LVL 62

Expert Comment

by:gheist
ID: 9610304
some systems call it fstat or pstat. lsof is more complete sometimes.
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question