Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

see who is currently using a file

Status
Not open for further replies.

AP81

Programmer
Apr 11, 2003
740
AU
I have a RedHat fileserver set up with samba to allow 30+ people on our network to access the files on that machine.

What I want to be able to do is to be able to check whether a specific file is currently in use, and even better, who (which user on the network) is using it.

Is there any way to do this via the terminal or by the use of a third-party software tool? Any help or input is appreciated.

Thanks in advance.




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
there is a freeware utility lsof (list open files) (I have this on Solaris, but I think it comes from the freebsd/lunix world); this will show you the PID of the process (ie. the samba process) who has an open filehandle.

To find out the user who has opened this file will be a samba issue...

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - "Home of the Whopper", oh no, "Home of the Oktoberfest" ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
for SMB connections, try:

smbstatus -d

This will list all the opened files and what PIDs are using them.
 
The 'finger' command is also useful to get info about certain users.
Check the MAN page out.

Cheers,
71
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top