Score:0

How to get users running processes without it's username in it?

ru flag

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

Score:0
za flag

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.