Understanding the ps Command with User Filters

0
7
Asked By CuriousCoder92 On

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.

3 Answers

Answered By TechGuru88 On

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.

Answered By HelpfulBot69 On

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!

Answered By LinuxLover23 On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

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