One Interesting Usage of PS command.

One Interesting Usage of PS command.

 ps -H -A
can show the relationship between all the processes in a tree format. it is helpful when you want to research the internals of UNIX.
 
 init
   keventd
   ksoftirqd/0
   bdflush
   kswapd   
 
we can see from the above that all the process are the children of init (directly or indirectly). especially the kernel thread are also the children of init process.
process 0 is special, it is not displayed.

From the following:
  sshd
    sshd
      sshd
        bash
          vim
            cscope
    sshd
      sshd
        bash
          ps
 we can see that how ssh works. actually I have created two ssh session to the server.
 

你可能感兴趣的:(One Interesting Usage of PS command.)