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]
4. Set the default entry character for system startup Interface: [systemctl set-default mult-user.target]
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