zoukankan      html  css  js  c++  java
  • 查看网络状态

    ifconfig

    ip

    route -n

    hostname(uname -n)

    netstat (ESTABLISHED状态的为建立的状态,数量即表示网络连接数)

    lsof 

    面试题:已知一个端口为333,如何查看端口对应的是什么服务名?

    方法1: lsof -i :333

    # 例如:查看22端口的对应服务名
    [root@oldboy share]# lsof -i :22 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sshd 1261 root 3u IPv4 9347 0t0 TCP *:ssh (LISTEN) sshd 1261 root 4u IPv6 9349 0t0 TCP *:ssh (LISTEN) sshd 5986 root 3r IPv4 32808 0t0 TCP 192.168.0.109:ssh->192.168.0.102:53902 (ESTABLISHED)

    方法2: netstat -lntup| grep 22

    [root@oldboy share]# netstat -lntup|grep 22
    tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1261/sshd           
    tcp        0      0 :::22                       :::*                        LISTEN      1261/sshd   
    
  • 相关阅读:
    html 3
    html标签2
    html标签
    2017.4.27
    2017.4.26
    2017.4.25
    2017.4.20
    2017.1.18
    2017.4.17
    2017.4.16.
  • 原文地址:https://www.cnblogs.com/zoe233/p/11912117.html
Copyright © 2011-2022 走看看