//View Tip #817
Similar Tips
There are no more tips with these tags. Perhaps you'd like to submit one, or browse the archives.


Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
'top' is a usful command which provides a dynamic real-time view of a running system and something most people use regularly. However, a lot of people don't know that the output can be limited on a per user basis. 'top -u username' will just give output for the given user.

The following can be useful for shell scripts etc to perform 'top' for the current user:

top -u $(whoami)

View Comments »


Add your comment

Comments are currently disabled
From my man page

-U <user>
Only display processes owned by <user>.  Either the username or uid number can be specified.

-u Deprecated, equivalent to -ocpu -Otime.
Posted 2009-05-20 12:05:05
From my man page:

      -u : Monitor by user as:  -u somebody
           Monitor only processes with an effective UID or user name matching that given.

      -U : Monitor by user as:  -U somebody
           Monitor only processes with a UID or user name  matching  that  given.   This  matches  real,
           effective, saved, and filesystem UIDs.
Posted 2009-05-20 12:08:49
top under Linux is provided by procps [1]. My top is provided by Apple [2]

[1] http://sourceforge.net/projects/procps/
[2] http://www.opensource.apple.co … ource/top/
Posted 2009-05-21 11:40:11

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit