fuser - identify processes using a file or file structure

How can I see processes using a filesystem?

At work (solaris) we have fuser. I have no clue how to do this in Mac OS X.

lsof is great but not what I want.

Thanks

example:

sidewinder{26}eseale@5:55pm [/tmp] fuser /tmp
/tmp: 9000c 8905c
sidewinder{27}eseale@5:55pm [/tmp] cd
sidewinder{28}eseale@5:56pm [~] fuser /tmp
/tmp:
sidewinder{29}eseale@5:56pm [~]



old G5 Mac OS X (10.4.3)

Posted on Dec 16, 2005 5:58 PM

Reply
4 replies

Dec 17, 2005 4:43 AM in response to Eric Seale

Hi Eric,
I agree with Andy; lsof is by far the most flexible tool for doing what you want. You gave an example that involved a specific directory to "watch" and only lsof will do that. However, for the sake of completeness, there is another command called fs_usage. That must be run as root and looks at the entire filesystem. You can't tell it which files to watch but you can tell it which processes to monitor. One hint: use a large terminal window or use the -w switch. In absence of -w, the information output depends on terminal window size.
--
Gary
~~~~
Nothing cures insomnia like the realization that it's
time to get up.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

fuser - identify processes using a file or file structure

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.