Process management
-
- (1) Basic introduction
- (2) Display the process executed by the system
- (3) Terminate the process kill and killall
- (4) View the process tree pstree
- (5) Service management
-
-
- ① Introduction
- ② Service management instructions
- ③ Application case
- ④ Detailed discussion
- ⑤ View service name:
- ⑥ The runlevel of the service (runlevel):
- ⑦ chkconfig command
-
-
- Case 1: Please display the running status of all running levels of all services in the current system
- Case 2: Please check the running status of the sshd service
- Case 3: Set the sshd service to not start automatically under run level 5, and see what effect does it have?
- Case 4: When the run level is 5, turn off the firewall.
- Case 5: In all run levels, turn off the firewall
- Case 6: In all run levels, turn on the firewall
-
-
- (6) Dynamic monitoring process
- (7) Monitor network status
(1) Basic introduction
(2) Display the process executed by the system
① Basic introduction
② ps detailed explanation
③ Application examples
(3) Terminate the process kill and killall
① Introduction
② Basic grammar
③ Common options
④ Best practice
Case 1: Kick off an illegal login user
Case 2: Terminate the remote login service sshd, and restart the sshd service again at an appropriate time
Find the remote login process in the CentOS terminal and terminate the process
Disconnected in XShell
Case 3: Terminate multiple gedit editors
Case 4: Forcibly kill a terminal
(4) View the process tree pstree
① Basic grammar and common options
② Application examples
Case 1: Please display the pid of the process in the form of a tree
Case 2: Please use the user id of the process in the form of a tree
(5) Service management
① Introduction
② Service management instructions
③ Application case
Case: Check the current firewall status, turn off the firewall and restart the firewall.
④ Detailed discussion
⑤ View service name:
Method 1: Use setup-system services can be seen.
Method 2: /etc/init.d/service name
⑥ The runlevel of the service (runlevel):
⑦ chkconfig command
Case 1: Please display the running status of all running levels of all services in the current system
Case 2: Please check the running status of the sshd service
Case 3: Set the sshd service to not start automatically under run level 5, and see what effect does it have?
Case 4: When the run level is 5, turn off the firewall.
Case 5: In all run levels, turn off the firewall
Case 6: In all run levels, turn on the firewall
(6) Dynamic monitoring process
① Introduction
② Basic grammar
③ Interactive operation instructions
④ Application examples:
Case 1. Monitoring a specific user
top:输入此命令,按回车键,查看执行的进程。
u:然后输入“u”,再输入用户名,即可
Case 2: Terminate the specified process.
top:输入此命令,按回车键,查看执行的进程。
k:然后输入“k”,再输入要结束的进程ID号
Case 3: Specify the system status update time (automatically update every 10 seconds):
top -d 10
(7) Monitor network status
① Check system network status netstat
Case 1: Check the information of the service whose service name is sshd.
② Check the host connection command ping: