国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > linux下查找端口號(hào)對(duì)應(yīng)的服務(wù)名

    linux下查找端口號(hào)對(duì)應(yīng)的服務(wù)名

    時(shí)間: 志藝942 分享

    linux下查找端口號(hào)對(duì)應(yīng)的服務(wù)名

      linux命令在系統(tǒng)中有兩種類型:內(nèi)置Shell命令和Linux命令。那么你知道linux下查找端口號(hào)對(duì)應(yīng)的服務(wù)名么?接下來(lái)是小編為大家收集的linux下查找端口號(hào)對(duì)應(yīng)的服務(wù)名,歡迎大家閱讀:

      linux下查找端口號(hào)對(duì)應(yīng)的服務(wù)名

      1)grep -w 端口號(hào) /etc/services

      2)grep "\b端口號(hào)\b" /etc/services

      以2049端口為例,執(zhí)行g(shù)rep -w 2049 /etc/services或grep "\b2049\b" /etc/services 即可查找到其對(duì)應(yīng)的服務(wù)名為nfs

      grep -w 2049 /etc/services

      nfs 2049/tcp nfsd shilp # Network File System

      nfs 2049/udp nfsd shilp # Network File System

      nfs 2049/sctp nfsd shilp # Network File System

      # grep "\b2049\b" /etc/services

      nfs 2049/tcp nfsd shilp # Network File System

      nfs 2049/udp nfsd shilp # Network File System

      nfs 2049/sctp nfsd shilp # Network File System

      其中-w表示只顯示全字符合的列,即精確匹配;"\b"表示匹配一個(gè)字邊界,即字與空格間的位置。例如,“er\b”匹配“never”中的“er”,但不匹配“verb”中的“er”(若匹配“verb”中的“er”可使用"\B"進(jìn)行非字邊界匹配)。

      根據(jù)服務(wù)名查找對(duì)應(yīng)的端口號(hào)

      1)grep -w 服務(wù)名 /etc/services

      2)grep "\b服務(wù)名\b" /etc/services

      以nfs服務(wù)為例,執(zhí)行g(shù)rep -w nfs /etc/services 或grep "\bnfs\b"/etc/services即可查找到其對(duì)應(yīng)的端口號(hào)為2049

      # grep -w nfs /etc/services

      nfs 2049/tcp nfsd shilp # Network File System

      nfs 2049/udp nfsd shilp # Network File System

      nfs 2049/sctp nfsd shilp # Network File System

      # grep "\bnfs\b" /etc/services

      nfs 2049/tcp nfsd shilp # Network File System

      nfs 2049/udp nfsd shilp # Network File System

      nfs 2049/sctp nfsd shilp # Network File System

      其中-w表示只顯示全字符合的列,即精確匹配;"\b"表示匹配一個(gè)字邊界,即字與空格間的位置。\bnfs\b即為精確匹配nfs。

      
    看了“linux下查找端口號(hào)對(duì)應(yīng)的服務(wù)名”還想看:

    1.linux有什么常見服務(wù)端口

    2.LINUX的端口和服務(wù)有什么關(guān)系

    3.Linux常用網(wǎng)絡(luò)服務(wù)端口

    4.LINUX操作系統(tǒng)如何修改HTTPD的端口

    5.Linux中的Apache服務(wù)查看和啟動(dòng)的方法

    3029140