View Processes Owned by a Particular User


ps U [username]

Up to now you've been looking at how ps gives you a list of all processes on your system. If you want to limit the results to those owned by a single user, simply use the U option, followed by the username or number.

$ ps U scott   PID  TTY  STAT   TIME COMMAND 14928  ?    S      0:00 /opt/ooo2/program/soffice -writer 14957  ?    Sl     0:42 /opt/ooo2/program/soffice.bin -writer  4688 pts/4 S+     0:00 ssh scott@humbug.machine.com 26751  ?    Z      0:00 [wine-preloader] <defunct> 27955 pts/5 R+     0:00 ps U scott 


Of course, ps doesn't include the username in the listing because it was already part of the command.

Tip

Remember, if you don't know the user's number, just look in /etc/passwd. Find the username, and the user number is in the third column.




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