当前位置:网站首页>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
边栏推荐
- Express routing, express middleware, using express write interface
- C语音常用的位运算技巧
- es使用collapseBuilder去重和只返回某个字段
- Game 280 of leetcode week
- Wechat applet: Xingxiu UI v1.5 WordPress system information resources blog download applet wechat QQ dual end source code support WordPress secondary classification loading animation optimization
- 【CTF】AWDP总结(Web)
- La jeunesse sans rancune de Xi Murong
- batchnorm. Py this file single GPU operation error solution
- Application and development trend of image recognition technology
- 【LeetCode】88. Merge two ordered arrays
猜你喜欢

Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and mobile phones can also easily read literature

MATLB|多微电网及分布式能源交易

"2022" is a must know web security interview question for job hopping

R语言用logistic逻辑回归和AFRIMA、ARIMA时间序列模型预测世界人口

Stored procedure and stored function in Oracle

Roads and routes -- dfs+topsort+dijkstra+ mapping

Incremental backup? db full

Wechat applet: wechat applet source code download new community system optimized version support agent member system function super high income

What sparks can applet container technology collide with IOT

增量备份 ?db full
随机推荐
官宣!第三届云原生编程挑战赛正式启动!
Es uses collapsebuilder to de duplicate and return only a certain field
微信小程序:星宿UI V1.5 wordpress系统资讯资源博客下载小程序微信QQ双端源码支持wordpress二级分类 加载动画优化
R语言用logistic逻辑回归和AFRIMA、ARIMA时间序列模型预测世界人口
What is the length of SHA512 hash string- What is the length of a hashed string with SHA512?
Win: use shadow mode to view the Desktop Session of a remote user
Runc hang causes the kubernetes node notready
One plus six brushes into Kali nethunter
PowerShell:在代理服务器后面使用 PowerShell
Common bit operation skills of C speech
PHP wechat official account development
Database postragesql client connection default
19. Delete the penultimate node of the linked list
无心剑英译席慕容《无怨的青春》
Interesting practice of robot programming 16 synchronous positioning and map building (SLAM)
Wechat applet: independent background with distribution function, Yuelao office blind box for making friends
Remote control service
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!
【LeetCode】88. Merge two ordered arrays
Classification of performance tests (learning summary)