I have 2 terminals open. In terminal 1 I have bash running, then I run xlogo; xlogo is the child of course. If I type ps T o user,pid,tty,args,ppid it gives me:

USER         PID TT       COMMAND                        PPID
shahzeb     2526 pts/3    bash                           2248
shahzeb     2762 pts/3    xlogo                          2526
shahzeb     3152 pts/3    ps T o user,pid,tty,args,pp    2526

but if I do that in terminal 2 it does not list xlogo only bash with different pid.

My question is how can I type something in Terminal 2 and verify that the bash process in Terminal 1 is the parent process of the xlogo process?


The ps command, by default prints information about all processes with the same effective user id as the current user, and associated with the same terminal as the invoker. That's why you don't see xlogo or its parent bash process when running it from terminal 2.

If you want to see things outside the scope of the default behavior, then you'll need to pass additional arguments to ps to change that behavior. One option is to use the -A option, for example: ps -A T o user,pid,tty,args,ppid.

  • I think the T is not needed. The OP can try with his data ps -t pts/3 o user,pid,tty,args,ppid
    – ctac_
    Oct 17 '20 at 19:07
  • I didn't parse all the option the OP used, I just appended the -A to whatever the OP had. Oct 17 '20 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.