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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open files 1

Status
Not open for further replies.

apocalypse11

Technical User
Jan 11, 2001
77
AU
I have a linux server and access files via samba. when a user says there is a "file locked for editing" how can i find out exactly who the user is on the system that has the file open at that time - from the server side.

THanks
 
If you know the directory and filename on the Linux box, change to that directory and type: (don't include the {} brackets)

# fuser {filename}

You'll get the PID (Process ID) of the process which has the file open. You can then run:

# ps -ef | grep {PID}

On some (most?) versions, you can also just type:

# fuser -u {filename}

This should present both the PID and the UserID.
 
man works by typing "man" followed by the name of a command you are interested in learning about.

ex.
man fusuer

This will display information about 'fuser' command.

ex.
man lsof

This will display information about the 'lsof' command.

ex.
man man

This will display information about the 'man' command.

It's quite the useful utility, you should use it.
 
Thanks to everyone... Ericbrunson - it is if you can understand it - thats ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top