Filter top using process name in Linux

To display statistics only for a process name that match a string using top, you could use the following:

top -c -p $(pgrep -d',' -f firefox)

Here is a screenshot which only shows stats for firefox:

top filtered output screenshot in Linux

Hope this helps! Cheers!


Source/Credits/Reference: StackOverflow

One thought on “Filter top using process name in Linux

  1. Another method:

    Press the ‘o’ or ‘O’ to activate filter prompt. It will show a line indicating the filter format like this –

    add filter #1 (ignoring case) as: [!]FLD?VAL

    Then enter a filter like this and hit Enter.


    Now top will show only those processes whose COMMAND field contains the value apache.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.