Skip to content

MacOS常用命令

查询占用端口号

shell
# 命令格式
lsof -ti:[端口号]

# 例子: 8080端口是否被占用,返回进程号
lsof -ti:8080