LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-24-2004, 11:53 AM   #1
pfunk
Member
 
Registered: Jun 2002
Distribution: Suse, Redhat, Knoppix
Posts: 104

Rep: Reputation: 15
Seeing all processes with 'ps'


I have two terminal windows open in redhat 9, both are the user pfunk.

I can't seem to get 'ps' to display all the processes of both open terminals. I have the bash shell and some C programs running and when i type 'ps' I can only see the shell process and the C programs of the one window where i'm running 'ps'.

what do i have to do to get ps to show all of those processes

I tried:
ps -A
ps -e
ps -au | grep pfunk

ideas?
 
Old 03-24-2004, 11:56 AM   #2
tmorton
Member
 
Registered: Jan 2003
Location: In front of my computer in Oregon, USA
Distribution: Slackware
Posts: 198

Rep: Reputation: 31
Use ps aux

You can use grep to only show certain processes.
--Taj
 
Old 03-24-2004, 12:03 PM   #3
pfunk
Member
 
Registered: Jun 2002
Distribution: Suse, Redhat, Knoppix
Posts: 104

Original Poster
Rep: Reputation: 15
thanks that works but i'm not sure I understand why.

why is the x option necessary ... i thought x was for processes that you started with nohup or other ones that weren't tied to a terminal. or is it for processes not tied to the terminal in which you're running 'ps'?
 
Old 03-24-2004, 12:05 PM   #4
tmorton
Member
 
Registered: Jan 2003
Location: In front of my computer in Oregon, USA
Distribution: Slackware
Posts: 198

Rep: Reputation: 31
Hi,
man ps:
x select processes without controlling ttys

It's for all processes, regardless of they were started from a tty or not.
--Taj
 
Old 03-24-2004, 12:07 PM   #5
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
When many processes are started they aren't tied to a terminal. When you do a
ps aux
you'll see column with some entries like
ttyS2
or
pts/0
but a lot with a
?
which aren't tied to a terminal
 
Old 03-24-2004, 12:13 PM   #6
pfunk
Member
 
Registered: Jun 2002
Distribution: Suse, Redhat, Knoppix
Posts: 104

Original Poster
Rep: Reputation: 15
I understand that the x is for processes that aren't tied to a terminal. i guess I don't understand why my process isn't tied to a terminal.

In other words, how come when I run a C program from the command line (by typing ./a.out ) it is displayed with just a plain old 'ps' if I type 'ps' in the same window as I ran the C program. but if I type 'ps' in a different window then the same program doesn't show up?
 
Old 03-24-2004, 12:34 PM   #7
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Your program was launched from the first shell...the second shell is not associated with the program. A simple ps from the second shell isn't going to mention anything associated with the first shell...they're separate branches of the big ol' process tree.
 
  


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
Quick question about 'ps' Adrohak Linux - Security 4 05-12-2005 02:10 PM
To many #*$!$@!%! Processes! vaderj Linux - General 4 01-01-2005 10:31 PM
monitoring active processes and identifying the required processes. gajaykrishnan Programming 2 08-13-2004 01:58 AM
'ps' Blues Odd_Bloke Linux - Newbie 3 08-30-2003 12:03 AM
processes nautilus_1987 Linux - Software 11 09-28-2002 06:55 AM

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

All times are GMT -5. The time now is 03:50 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