LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-15-2003, 12:54 PM   #1
eDubster
LQ Newbie
 
Registered: Apr 2003
Posts: 9

Rep: Reputation: 0
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.
 
Old 04-15-2003, 01:16 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Filter for what? A text string? Try:
ps -u $USER | grep STRING
 
Old 04-15-2003, 01:39 PM   #3
eDubster
LQ Newbie
 
Registered: Apr 2003
Posts: 9

Original Poster
Rep: Reputation: 0
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,
 
Old 04-15-2003, 03:55 PM   #4
doublefailure
Member
 
Registered: Mar 2002
Location: ma
Distribution: slackware
Posts: 747

Rep: Reputation: 30
something like this?

ps -ef | uniq --skip-fields=8
 
Old 04-15-2003, 04:09 PM   #5
eDubster
LQ Newbie
 
Registered: Apr 2003
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 04:35 PM
command to list threads minil Programming 1 01-10-2005 05:43 AM
Getting AND filtering the output of "wvdial" rkrijger Linux - Software 0 11-17-2003 08:02 AM
Threads showing up as processes on ps command eDubster Linux - General 1 04-28-2003 04:51 PM
Sendmail Spam filtering and Virus filtering MrJoshua Linux - General 2 04-03-2003 10:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration