Operating System - HP-UX
1843825 Members
4381 Online
110224 Solutions
New Discussion

Command for 'file in use'

 
SOLVED
Go to solution
melvin mariney
Occasional Contributor

Command for 'file in use'

Is there a command that will tell me if a file is in use, and if so, what process is using the file.

thanks in advance.
You never stop learning...
2 REPLIES 2
Thomas G. Tudrej
Frequent Advisor
Solution

Re: Command for 'file in use'

try "fuser", it spits out pid's of processes that hold it open. Thre is also an unsupported command "lsof", list open files that lists all open files in a dir of file system (http://hpux.cs.utah.edu/)
Steven Sauve
New Member

Re: Command for 'file in use'

Hi,
fuser will tell you if a file is in use and who is using it. As a side note it can also tell you if a lvol is in use. Check the man page for appropriate switches, but I believe that fuser -fu (filename) should do it.

Hope this helps,
Steve