45

How can I read top in bash only for one user? I don't want it to display data for other users.

2 Answers2

60

From man top:

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

So, if you run top -u root you'll get only root processes.

m0nhawk
  • 3,863
2

If you already started top, you can also press the u key and enter the username in the status line.

In case you want to show all users again (make the selection undone), press the = key or respectively the + key to clear the selection criteria in all top windows.

abu_bua
  • 558
  • 9
  • 9