I'm trying to write all users and their running processes in file using: ps -r -U username -o pid,command,user > up.txt
But I don't need commands that contains users name in it.
How can I filter commands by their name?
Example
22312 ps -ls username
16411 ps -r -U username -o pid,com username
I need to get only 22312 row