Loading....

ps

run without parameters will only show you  the process associated with the current terminal:

$ ps
          PID TTY            TIME CMD
      18614 pts / 3 00:00:00 bash
      20173 pts / 3 00:00:00 ps

Like many UNIX ® tools, ps also has a lot of options, the most commonly used are:

       a: shows all tty, including other users;
   
       x: print non-controled terminal or the tty which not controled by current terminal;

       u: display user-oriented format,shows the user and the start-up time of the process.

need other relevant options, please refer to ps (1) manual page.

the ps command is commonly used as follows:

$ ps ax | less

This command will print the list of all processes that is currently running , so you can find out where or what the processes that have problems, and then terminate them.

pstree

pstree command is used to display the process tree. The advantage is that you can immediately find out the parent process of a process: when you want to terminate the entire series  of the process and there are many subordinate branches of the process, what do you need to do is to terminate the process at the top level. You may need to use the -p option to display each process's PID, as well as the -u option to display the user of the process. In general, the tree struct of the process is very long, you need to run pstree just like this:

$ pstree-up | less

This will allow you to overview the entire tree structure of processes .

Reference URI:https://ubuntu-sky.blogspot.com/2009/04/ps-and-pstree.html

Have not found what you want?? Try to search by Google

Quote URI


Share/Save/Bookmark

Related Articles

Comments: 0 comments

Post a Comment

Archives

Recent Entries

Recent Comment

Powered By Blogger