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
原文:https://www.cnblogs.com/SouthRiverKing/p/12845208.html