LINUX运维笔试题
2882 ワード
Linux route add using route command
Route all traffic via 192.168.1.254 gateway connected via eth0 network interface:
# route add default gw 192.168.1.254 eth0
Linux route add using ip command
Just like above but with ip command:
# ip route add 192.168.1.0/24 dev eth0
william@ubuntu:~$ netstat -lnt4
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:46225 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:53429 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:54234 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:9418 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
william@ubuntu:~$ sed "1,2d" stat.txt | awk '{print $4}' | cut -d: -f1 | sort | uniq --count
9 0.0.0.0
2 127.0.0.1
//google: shell count duplicate lines SELECT GroupId, COUNT(GroupId)
FROM Members
GROUP BY GroupId
ORDER BY COUNT(GroupId) DESC