2

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.

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

2 Answers 2

2

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

top | grep -v firefox
2
  • 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. Commented Nov 5, 2018 at 1:10
  • @DKBose: Beautiful!, I don't expect that pipe through grep still make top monitor other processes. Commented Nov 5, 2018 at 1:36
2

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)

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.