View network status

ifconfig

ip

route -n

hostname(uname -n)

netstat (ESTABLISHED state is the state established, i.e., the number represents the number of network connections)

lsof 

 

Interview questions: a port known as 333, corresponding to the port to see how the service name is what?

Method 1: lsof -i: 333

# For example: to see the corresponding service name 22 port 
[root @ Oldboy report this content share] # lsof -i: 22 the COMMAND PID the USER FD the TYPE the DEVICE SIZE / OFF NODE NAME sshd 1261 9347 0t0 root 3U IPv4 TCP * : SSH (LISTEN) sshd 1261 root 9349 0t0 * IPv6 TCP 4U : SSH (LISTEN) sshd 5986 root 3R 32808 0t0 IPv4 TCP 192.168.0.109:ssh->192.168.0.102:53902 (the ESTABLISHED)

Method 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   

 

Guess you like

Origin www.cnblogs.com/zoe233/p/11912117.html