当前位置:网站首页>Process scheduling and termination
Process scheduling and termination
2022-07-05 01:46:00 【*_ Flowers are not strangers_*】
One . The main command tool for process scheduling and termination
1. Command line &: Run the command line in the background
2.Ctrl + z Composite key : Suspend current process ( Pause and go backstage )
3.jobs: List the background tasks of the current terminal of the current user
4.bg Number : Start the background task with the specified number
5.fg Number : Transfer the background task with the specified number into the foreground to run
6.kill [-9] PID...: Kill designated PID Value process
7.kill [-9] %n: Kill No n A backstage task
8killall [-9] Process name ...: Kill all processes with the specified name
9.pkill: Kill the process according to the specified name or condition
Two . Case study
1. Kill designated PID process
[[email protected] ~]# sleep 1000 & # Open in the background sleep Mission
[1] 76672
[[email protected] ~]# ps aux | grep sleep # Filter process information ( The second as PID)
root 76672 0.0 0.0 107948 352 pts/0 S 23:28 0:00 sleep 1000
root 76740 0.0 0.0 112704 960 pts/0 R+ 23:28 0:00 grep --color=auto sleep
[[email protected] ~]# kill -9 76672 # Kill designated PID process
[[email protected] ~]# jobs #sleep The process has been killed
[1]+ Killed sleep 1000
2. Kill multiple processes according to the process name
# step 1: Open multiple in the background vim process
[[email protected] ~]# vim a.txt &
[1] 77890
[[email protected] ~]# vim b.txt &
[2] 77915
[1]+ Stopped vim a.txt
[[email protected] ~]# vim c.txt &
[3] 77944
[2]+ Stopped vim b.txt
# step 2: Confirm the process information
[[email protected] ~]# jobs
[1] Stopped vim a.txt
[2]- Stopped vim b.txt
[3]+ Stopped vim c.txt
# step 3: Force to kill all people named vim The process of
[[email protected] ~]# killall -9 vim
# step 4: Confirm that the process is killed
[[email protected] ~]# jobs
[1] Killed vim a.txt
[2]- Killed vim b.txt
[3]+ Killed vim c.txt
3. Kill all processes belonging to the specified user
step 1: Log in to test user
[[email protected] ~]# useradd test # Create user
[[email protected] ~]# su - test # Switch to test user
[[email protected] ~]$
step 2: Create a new terminal to manage root Sign in , Search for users test The process of
[[email protected] ~]# pgrep -u test # Retrieve the user's PID
84860
[[email protected] ~]# pstree -up 84860 # Check the process tree
bash(84860,test)
# step 3: Force to kill the process belonging to the user
[[email protected] ~]# pkill -9 -u test # Kick out the logged in user test
# step 4: Return to the original test terminal , Confirmation has been terminated
[[email protected] ~]$ Killed
边栏推荐
- Wechat applet: exclusive applet version of the whole network, independent wechat community contacts
- Wechat applet: new independent backstage Yuelao office one yuan dating blind box
- Win:使用 PowerShell 检查无线信号的强弱
- Yyds dry inventory jetpack hit dependency injection framework Getting Started Guide
- How to safely eat apples on the edge of a cliff? Deepmind & openai gives the answer of 3D security reinforcement learning
- Main window in QT application
- Four pits in reentrantlock!
- . Net starts again happy 20th birthday
- Delaying wages to force people to leave, and the layoffs of small Internet companies are a little too much!
- Practice of tdengine in TCL air conditioning energy management platform
猜你喜欢
DOM basic syntax
Stored procedure and stored function in Oracle
Comment mettre en place une équipe technique pour détruire l'entreprise?
Win:使用 PowerShell 检查无线信号的强弱
What sparks can applet container technology collide with IOT
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
微信小程序:全新独立后台月老办事处一元交友盲盒
Yyds dry goods inventory [Gan Di's one week summary: the most complete and detailed in the whole network]; detailed explanation of MySQL index data structure and index optimization; remember collectio
Blue Bridge Cup Square filling (DFS backtracking)
Codeforces Global Round 19 ABC
随机推荐
Classification of performance tests (learning summary)
The application and Optimization Practice of redis in vivo push platform is transferred to the end of metadata by
Practice of tdengine in TCL air conditioning energy management platform
batchnorm.py这个文件单GPU运行报错解决
Unified blog writing environment
流批一体在京东的探索与实践
187. Repeated DNA sequence - with unordered_ Map basic content
Codeforces Round #770 (Div. 2) ABC
Express routing, express middleware, using express write interface
微信小程序:独立后台带分销功能月老办事处交友盲盒
R language uses logistic regression and afrima, ARIMA time series models to predict world population
Lsblk command - check the disk of the system. I don't often use this command, but it's still very easy to use. Onion duck, like, collect, pay attention, wait for your arrival!
Win: use shadow mode to view the Desktop Session of a remote user
How to safely eat apples on the edge of a cliff? Deepmind & openai gives the answer of 3D security reinforcement learning
R语言用logistic逻辑回归和AFRIMA、ARIMA时间序列模型预测世界人口
MySQL backup and recovery + experiment
MATLB | multi micro grid and distributed energy trading
JS implementation determines whether the point is within the polygon range
PHP Joseph Ring problem
C basic knowledge review (Part 3 of 4)