Skip to content

Instantly share code, notes, and snippets.

@firefirer1983
Last active April 28, 2020 09:40
Show Gist options
  • Save firefirer1983/b5b4a6d94c072872e1e802208da21dbf to your computer and use it in GitHub Desktop.
Save firefirer1983/b5b4a6d94c072872e1e802208da21dbf to your computer and use it in GitHub Desktop.
linux 查看端口占用

linux 下查看进程占用端口:

  1. 查看程序对应的进程号: ps -ef | grep 进程名字

  2. 查看进程号所占用的端口号

  • linux:
netstat -nltp | grep  进程号
  • ubuntu:
netstat -anp | grep pid

linux 下查看端口号所使用的进程号(使用 lsof 命令):

lsof -i:端口号
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment