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? |
Use ps aux
You can use grep to only show certain processes. --Taj |
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'? |
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 |
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 |
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? |
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. |