当前位置:网站首页>RHCSA7

RHCSA7

2022-07-05 12:50:00 Grey rain

Linux Process introduction
process : Started program
Process status :stop、running、sleep
ps List the processes in the system
ps -ef
ps aux
The output of the two is not much different , But the display style is different .aux yes BSD style ,-ef yes System V style . This is a minor difference , One difference that affects use is aux Will be truncated command Column , and -ef Can't .

top Dynamic display process status ( Memory consumption is higher than others )
It can be used ? See sort by

Process management and performance query
Foreground process
example :sleep 10(10s The internal front desk cannot be operated )

Background processes
example :
sleep 1000 &( Create background process )
ps -ef | grep sleep perhaps jobs
bg Process number ( Background running process )
fg Process number ( The foreground runs the process )

The end of the process
kill
-l Check what you can use
9 Force end process , Regardless of process status
15 The end of the process , Automatic end ( Don't write default 15)
How to write it :kill num Process number
kill all name End all name process

pkill
-U user end user All processes
-t terminal

Load average
vmstat 2
ctrl+z
 Insert picture description here

Control services and daemons
systemctl
systemctl isolate multi-user.target Enable command line interface
systemctl list-units View system services
systemctl list-units --all View all services of the system
systemctl list-units -file service

systemctl is-failed/active/enable/runing View service status
How to write it :systemctl is-failed sshd

systemctl stop Service name
systemctl reload Service name
systemctl restart Service name
systemctl status Service name

原网站

版权声明
本文为[Grey rain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140524343242.html