List a User s Open Files


List a User's Open Files

lsof -u

If you want to look at the files a particular user has open (and remember that those include network connections and devices, among many others), add the -u option to lsof, followed by the username (remember that lsof must be run as root).

Note

In order to save space, some of the data you'd normally see when you run lsof has been removed in this and further examples.


# lsof -u scott COMMAND    PID  USER  NAMEP evolution 8603  scott /home/scott/.evolution/addressbook/local/system/addressbook.db opera    11638  scott /usr/lib/opera/9.0/opera opera    11638  scott /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf 


Even filtering out all users except one, you're left with 3,039 lines in this list. Still, some interesting items are here. For one, it appears that Evolution (an email and personal information manager program) is running all the time, without your knowledge or intention. Also, the Opera web browser is running, which is expected, and one of the web pages it's on is requiring the use of the Arial Bold font, among other files.

If you administer a box used by more than person, try out lsof -u for your users. You might find that they are running programs that they shouldn't. If you're the sole user on your Linux machine, try lsof -u on yourselfyou might find that you're running programs of which you were unaware!



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net