Process and service management operations (1)

1. View the list of ports monitored by the system: [netstat -ntlp]
2. The process is bound to the CPU: [taskset]
3. View the processes running in the background in the current terminal: [jobs -l]
Insert picture description here
4. Set the default entry character for system startup Interface: [systemctl set-default mult-user.target]
Insert picture description here
5. Terminate the process
    1) Foreground process: ctrl+c [terminate process] or ctrl+z [process enters suspended state]
    2) Background process:
        ①View by process ID Occupied port number

#通过进程名称查找对应的线程号PID
ps -ef |grep tomcat
#查看端口对应的程序以及线程号PID,两种方式
netstat –apn | grep 端口号
lsof -i:8080 
#强制终止后台运行的进程
kill -9 线程号PID

Guess you like

Origin blog.csdn.net/weixin_43161762/article/details/113573478