How can I exclude Chrome/Firefox processes from top command output? It's just too messy with them in there, and it isn't important for me to see them there.

  • 2
    See this Q/A on ServerFault: serverfault.com/a/141442 – JamoBox Nov 4 '18 at 9:48
  • 2
    killall chrome and killall firefox is one way to make them go away ... ;) – Hagen von Eitzen Nov 4 '18 at 13:40
  • Lol, messy output to analyze is not good. Killing won't help. – Tuyen Pham Nov 4 '18 at 15:48

As top is a compiled program, you'd need to modify the source code. Using ps it's easily achieved by using:

ps aux | grep --invert-match firefox

to exclude firefox.

Note: I don't have Chrome, so don't know what the process name is but adding | grep --invert-match chrome at the end of the above command should accomplish both if and only if Chrome's process name is chrome (educated guess)

| improve this answer | |
  • Nice one, how to have the same effect as top with tree and only show process of a specific user? – Tuyen Pham Nov 4 '18 at 11:09
  • tree is for directories, so I don't get it, so if I were you, I'd ask a new question. ;-) – Fabby Nov 4 '18 at 23:09

The top command is very command-line friendly. Try launching top like this:

top | grep -v firefox
| improve this answer | |
  • 1
    top | grep -Ev "(firefox|Web|chrome)" works for me on Kubuntu 18.04 with both Firefox and Google Chrome running. Web is for Web Content which is what Firefox shows when YouTube is playing. – DK Bose Nov 5 '18 at 1:10
  • @DKBose: Beautiful!, I don't expect that pipe through grep still make top monitor other processes. – Tuyen Pham Nov 5 '18 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.