linux常用指令
已知进程杀死进程
- ps aux:查看所有进程
- ps aux | grep nginx : 查看nginx进程
- kill -9 pid:杀死pid进程
已知端口杀死进程
方案一
- 查看哪些端口被占用(tcp,udp)
1 | |
- 杀死端口进程
1 | |
方案二
查看端口的进程
1
2
3
4
5
6
7
8lsof -i :[端口]
#例如
lsof -i :8080
#输出
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpServe 24009 xiadong 3u IPv4 1496040 0t0 TCP *:http-alt (LISTEN)杀死这个进程
1 | |
查看公网ip
1 | |
查看内网ip
1 | |
linux常用指令
http://example.com/2024/01/17/linux/linux常用命令/