LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Seeing all processes with 'ps' (https://www.linuxquestions.org/questions/linux-general-1/seeing-all-processes-with-ps-161845/)

pfunk 03-24-2004 11:53 AM

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?

tmorton 03-24-2004 11:56 AM

Use ps aux

You can use grep to only show certain processes.
--Taj

pfunk 03-24-2004 12:03 PM

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'?

tmorton 03-24-2004 12:05 PM

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

darthtux 03-24-2004 12:07 PM

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

pfunk 03-24-2004 12:13 PM

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?

mikshaw 03-24-2004 12:34 PM

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.


All times are GMT -5. The time now is 02:19 AM.