Top Command – Excluding Users

top

I'm trying to use the top command and exclude two users from showing in the iteration I'm sending to the textfile.

I have used the -u='!user' command-line option, but I can only exclude 1 user with it and am not able to use the option more than once.

I found a suggestion to use the command:

o!USER=user <enter> o!USER=user

but I'm fairly lost in how to implement it without getting an error.

Best Answer

If I understand you correctly, would this help?

top | grep -ve "user1" -e "user2"
Related Question