1. View of the process:
Ps–el
--E: Show all processes, including those without control terminal
--l: Display in long format
The results show:
PID: Process Number
PPID: Parent Process
TTY: Control terminal
Stat: The current state of the process where S: Indicates sleep state, D: Non-interruptible sleep Z: Zombie status R: Running
NI: View Process priority
Time: The total duration of the launch
Ps–aux
--A: Show All Processes
--u: Show Users
--x: Show non-terminal processes
Ps–aux–sort PID
Sort by Process number
2. Kill the process:
Xclock Open Time Process
Ps–aux | grep xclock Find to process number
Kill Process Number
Kill–s Signal Process Number
Kill–l List all signals
For example: Kill–s 19 2051//19: Indicates a stop signal, can be viewed by Kill–l, 2051 represents the time process number
Killall process name kills all processes
For example:
Service httpd start//Turn on HTTP service
Ps–aux | grep httpd
Killall httpd
Xkill Graphical interface can use this command to kill graphical interface Ctrl+alt+tab exit
3. Change the priority of the process
Nice-n level Process number//Specify process
Renice n PID//running process, changing the priority of the process
4. Real-time Process view
Top: Real-time viewing process, automatically refreshed every five seconds
-D: Show the first few Eg:top–d 3//Show only the first three
-C: Displays the entire command line and not just the command name
-Q: Update the displayed information immediately
U: View Users
H? : Help
K: Kill Process
NQ: Exit
5. Process hangs
Xclock &//Indicates that the Xclock process is being run in the background
CTRL +Z//Background run hangs
Ctr +c
Jobs: View all the processes in the background
FG N: Get the background process to the foreground n indicates the job number
BG N: Put in the background
Linux command explanation-process view