Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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'?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.