0

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

FeoJun
  • 1

1 Answers1

0

to be honstly the answer would be it depends quick and short on debian:

ps | cut -c -6

since it depends on the usage (context) , the used distribution and atm of posting this answer, of information on the question

djdomi
  • 1,377
  • 3
  • 10
  • 19