LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Need help filtering out threads in ps command output (http://www.linuxquestions.org/questions/linux-general-1/need-help-filtering-out-threads-in-ps-command-output-55164/)

eDubster 04-15-2003 12:54 PM

Need help filtering out threads in ps command output
 
Anyone know of a simple way to filter the threads out of the output of ps -u $USER command?

TIA for any answers.

david_ross 04-15-2003 01:16 PM

Filter for what? A text string? Try:
ps -u $USER | grep STRING

eDubster 04-15-2003 01:39 PM

no, not a particular string.

A multi-threaded process will show up n times if it has n-1 threads. I do not want to see that many instances of it in the ps output.

thanks,

doublefailure 04-15-2003 03:55 PM

something like this?

ps -ef | uniq --skip-fields=8

eDubster 04-15-2003 04:09 PM

Thanks Double failure...

i was trying something like this...It also worked, but I think uniq might be more efficient.

ps -o pid,tty,args `ps -u $USER -o ppid,pid | egrep '\b1\b' | awk '{print $2}'` | grep -v tcsh | grep -v 'ps -u' | grep -v grep | grep -v xterm


All times are GMT -5. The time now is 04:38 AM.