First, view the process
understand the process status of the system is a prerequisite for process management, using a different process status command to view from different angles.
1, ps command
ps command is the most commonly used Linux system, the process of viewing tools, mainly used to display a static snapshot contains complete information on the processes currently running. Through the different options, you can selectively view process information.
a: show all processes information in the current terminal, including those of other users
u: user-based process state
x: a generally used with this parameter, the current user terminal processes the information in all
-e: Display System All process information
-l: long format process information
-f: use the full format process information
to perform "ps aux" command. It will show the process information in the form of a simple list.
The first line lists the title meaning of each field of
the implementation of "ps -elf" command, the process will be long-format display system information, and contains richer content.
The first line lists the meaning of each field title
2, top command
top terminal command will display the current full-screen interactive interface process rankings, timely tracking CPU, memory and other system resources occupancy three seconds to refresh the default every time, its role is similar task windows system Manager.
Meaning top of each command line arguments
3, pgrep command
using the name of the process according to pgrep command, multi-attribute queries in a specific process of the user running the process, terminal and other processes where the PID number.
View all processes such as user fan is running.
pstree command
pstree output Linux system can command the tree structure of the various processes, more visually it determines the relationship between the processes.
Second, the control process
1, the boot process
in Linux system can be started manually by the user or start a new process in accordance with the schedule scheduling.
1), to start the process manually
process is generally divided into foreground process and background process, a process running in the foreground, the user must wait until the end of the process to carry out other operations, but when we execute a relatively long time to order, do not do the operation is inevitable that some waste of time then it is our turn to play a role in a background process, a process running in the background without waiting for its completion can operate other commands. Start running in the background need to add the final ampersand execute commands.
For example, we make copies of image files in Packages, and place it in the background.
2), operating mode change the course of
Ctrl + z: Suspend current process
jobs -l: Check background process
fg: recovery process
kill -9: End Process
Use the killall command to terminate the process
Use the pkill command to terminate the process