lsof
1.1、lsof简介
是什么 ?:List Open Files
开发语言:C
官方主页:https://people.freebsd.org/~abe
源码仓库:https://github.com/lsof-org/lsof
1.2、通过包管理器安装lsof
操作系统包管理器安装命令
macOSHomeBrewbrew install lsof
GNU/LinuxLinuxBrewbrew install lsof
aptsudo apt-get install -y lsof
CentOSyumsudo yum install -y lsof
dnfsudo dnf install -y lsof
openSUSEzyppersudo zypper install -y lsof
Alpine Linuxapksudo apk add lsof

Arch Linux

ArcoLinux

Manjaro Linux

pacmansudo pacman -Syyu --noconfirm
sudo pacman -S    --noconfirm lsof
Gentoo LinuxPortagesudo emerge lsof
1.3、通过编译源码安装lsof
1.4、lsof命令

查看端口被哪个进程占用:

lsof -i tcp:1935