macOS上查看端口占用情况——lsof命令备忘
lsof -i[46] [protocol][@hostname|hostaddr][:service|port]
46: IPv4 or IPv6
protocol: TCP or UDP
hostname: Internet host name
hostaddr: IPv4 address
service: /etc/service service name
port --> port number
# lsof -i :22 # for example