To monitor and control the process, you must first understand the current process, which is to see the current process, while the PS command (process Status) is the most basic and very powerful process view command.
Use this command to determine which processes are running and running, whether the process is complete, if the process has no zombies, which processes are consuming too many resources, and so on. In short, most of the information can be obtained by executing the command.
PS provides us with a one-time view of the process, it provides the view results are not dynamic continuous;
If you want to monitor process time, you should use the top tool.
If you use the PS command directly, the status of all processes is displayed, usually in conjunction with the grep command to see the status of a process.
grep (Global search Regular expression (RE) and print out of the line, full search of regular expressions and print out rows) is a powerful text search tool that uses regular expressions to search for text. and print out the matching lines.
Examples of Use:
[[Email protected] updatedb]# PS Aux|grep./update_stock
Root 14232 0.0 0.0 5928 724 pts/1 s+ 18:16 0:00 grep./update_stock
Root 25021 0.0 0.0 3056 816? S Apr12 0:03./update_stock
PS aux output format:
USER PID%cpu%MEM VSZ RSS TTY STAT START time COMMAND
Format Description:
User: Owner of the itinerary
Pid:pid
%CPU: CPU Usage consumed
%MEM: Usage of memory consumed
VSZ: Virtual Memory size occupied
RSS: Size of memory consumed
TTY: Secondary device number for the terminal (minor device numbers of TTY)
STAT: The state of the trip, the Linux process has 5 states:
D non-interruptible uninterruptible sleep (usually IO)
R run runnable (on run queue)
S Interrupt Sleeping
T stop traced or stopped
Z Zombie a defunct ("zombie") process
Note: Other states also include w (no-dwell page), < (high-priority process), N (low-priority process), L (Memory lock page).
Start: Trip start time
Time: When it was executed
Command: the command executed
1) PS A shows all the programs under the current terminal, including other users ' programs.
2) ps-a Show All Programs.
3) PS C lists the program, displays the actual instruction name of each program, and does not include the path, parameter or the indication of the resident service.
4) Ps-e The effect of this parameter is the same as specifying the "A" parameter.
5) When listing the program, PS e displays the environment variables used by each program.
6) PS F Displays the tree structure with ASCII characters, expressing the relationship between the programs.
7) ps-h shows the tree structure, indicating the relationship between the programs.
8) Ps-n shows all the programs except the program under the PS Command Terminal.
9) PS s uses the program signal format to display the program status.
PS S when listing programs, including interrupted sub-program data.
One) ps-t specify the terminal number and list the status of the program belonging to that terminal.
PS U Displays the status of the program in a user-oriented format.
PS x Displays all programs and does not differentiate by terminal.
PS is the process that shows the current state in running, and grep means searching in these, and PS aux is showing all processes and their status.
$ ps aux | grep Amoeba
To find out the amoeba process.
$ kill-s 9 pid
Kill process
Linux command ps aux|grep xxx detailed