We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
查看指定端口号语法格式:lsof -i:端口号 如果命令找不到 yum install lsof -y
lsof -i:端口号
yum install lsof -y
[root@localhost ~]# lsof -i:7075 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME docker-pr 17394 root 4u IPv6 75775 0t0 TCP *:7075 (LISTEN)
查看所有端口占用: lsof -i
lsof -i
[root@vultr ~]# lsof -i COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME chronyd 421 chrony 5u IPv4 15794 0t0 UDP localhost:323 chronyd 421 chrony 6u IPv6 15795 0t0 UDP localhost:323 dhclient 759 root 6u IPv4 16886 0t0 UDP *:bootpc sshd 822 root 3u IPv4 18590 0t0 TCP *:ssh (LISTEN) sshd 822 root 4u IPv6 18599 0t0 TCP *:ssh (LISTEN) python 984 root 4u IPv6 19154 0t0 TCP *:cbt (LISTEN) python 984 root 6u IPv6 19155 0t0 UDP *:cbt python 984 root 9u IPv4 19174 0t0 UDP *:37738
用于显示 tcp,udp 的端口和进程等相关情况:netstat -tunlp netstat 查看端口占用语法格式:netstat -tunlp | grep 端口号
netstat -tunlp
netstat -tunlp | grep 端口号
[root@localhost ~]# netstat -tunlp | grep 7075 tcp6 0 0 :::7075 :::* LISTEN 17394/docker-proxy [root@localhost ~]# [root@localhost ~]# netstat -tunlp | grep 3306 tcp6 0 0 :::3306 :::* LISTEN 19356/mysqld [root@localhost ~]# [root@localhost ~]# netstat -tunlp | grep 1521 tcp6 0 0 :::1521 :::* LISTEN 17470/docker-proxy [root@localhost ~]# [root@localhost ~]# netstat -tunlp | grep 1525 [root@localhost ~]# [root@localhost ~]# netstat -tunlp | grep 1522 tcp6 0 0 :::1522 :::* LISTEN 17436/docker-proxy [root@localhost ~]#
显示本用户的进程:ps
ps
[root@localhost ~]# ps PID TTY TIME CMD 30059 pts/0 00:00:00 bash 31149 pts/0 00:00:00 ps
显示所有用户进程:ps aux 显示指定进程和其状态:ps -aux | grep 服务
ps aux
ps -aux | grep 服务
[root@localhost ~]# ps -aux | grep httpd root 31122 0.0 0.0 112680 696 pts/0 S+ 14:01 0:00 grep --color=auto httpd [root@localhost ~]# [root@localhost ~]# ps -aux | grep vsftpd root 31124 0.0 0.0 112680 696 pts/0 S+ 14:01 0:00 grep --color=auto vsftpd
终止进程:kill -9 [PID]
kill -9 [PID]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
lsof 列出当前系统打开文件
查看指定端口号语法格式:
lsof -i:端口号
如果命令找不到
yum install lsof -y
查看所有端口占用:
lsof -i
netstat
用于显示 tcp,udp 的端口和进程等相关情况:
netstat -tunlp
netstat 查看端口占用语法格式:
netstat -tunlp | grep 端口号
ps 显示当前进程状态
显示本用户的进程:
ps
显示所有用户进程:
ps aux
显示指定进程和其状态:
ps -aux | grep 服务
kill
终止进程:
kill -9 [PID]
The text was updated successfully, but these errors were encountered: