转自:How To Find The Port Number Of A Service In Linux
方法一:/etc/services文件
用法
grep <port/name> /etc/services
方法二:getent命令
[root@localhost bin]# getent services ssh ssh 22/tcp
getent services 会显示所有服务的端口号
转自:How To Find The Port Number Of A Service In Linux
方法一:/etc/services文件
用法
grep <port/name> /etc/services
方法二:getent命令
[root@localhost bin]# getent services ssh ssh 22/tcp
getent services 会显示所有服务的端口号