Understanding the ps Command with User Filters

February 13, 2026 3 answers
Asked by old growth survey
I'm trying to clarify how the ps command works, especially using the -e and -u flags together. A Linux engineer mentioned that our user, bobthebuilder, has a lot of processes running on a server. When I ran `ps -eT -u bobthebuilder | wc -l`, I got a count of 4109 processes. My concern is whether combining -e for all processes and -u for the specific user really filters correctly, because I noticed that it returned some root and daemon processes as well. Isn't that a bit misleading? I usually separate the two commands to avoid such confusion.

Answers

tangent plane
Great question! According to the man page for ps, the -e flag lists all processes, while -T focuses on those associated with the terminal. So when combined, it can pull back results that don't pertain to the specified user with -u. This might explain the discrepancies you're noticing.
Reply to this answer
unripe avocado
Check out our wiki for more resources on this! Understanding each part of the ps command is key, and practicing in a VM can help solidify your knowledge. Remember to always back up your data and verify commands before running them!
Reply to this answer
hedgerow habitat
You're spot on to be skeptical! When you run `ps -eT -u nobody`, you can clearly see processes that arenโ€™t owned by that user. So, your thought that the total count may not accurately reflect just the user's processes is valid.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions