cat
cut
tr
sort
uniq
head
tail
wc
awk
<pre>
root@tester [~]# ip r l
10.10.3.25 dev eth0 scope link src 10.10.3.25
10.10.1.25 dev eth0 scope link src 10.10.1.25
10.10.7.25 dev eth0 scope link src 10.10.7.25
10.10.5.25 dev eth0 scope link src 10.10.5.25
10.10.9.25 dev eth0 scope link src 10.10.9.25
10.10.2.25 dev eth0 scope link src 10.10.2.25
10.10.0.25 dev eth0 scope link src 10.10.0.25
10.10.6.25 dev eth0 scope link src 10.10.6.25
10.10.4.25 dev eth0 scope link src 10.10.4.25
10.10.8.25 dev eth0 scope link src 10.10.8.25
10.10.6.0/24 dev eth0 proto kernel scope link src 10.10.6.25
10.10.7.0/24 dev eth0 proto kernel scope link src 10.10.7.25
221.62.32.0/24 dev eth0 proto kernel scope link src 221.62.32.14
10.10.4.0/24 dev eth0 proto kernel scope link src 10.10.4.25
10.10.5.0/24 dev eth0 proto kernel scope link src 10.10.5.25
10.10.2.0/24 dev eth0 proto kernel scope link src 10.10.2.25
10.10.3.0/24 dev eth0 proto kernel scope link src 10.10.3.25
10.10.0.0/24 dev eth0 proto kernel scope link src 10.10.0.25
10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.25
10.10.8.0/24 dev eth0 proto kernel scope link src 10.10.8.25
10.10.9.0/24 dev eth0 proto kernel scope link src 10.10.9.25
169.254.0.0/16 dev eth0 scope link
default via 221.62.32.1 dev eth0
root@tester [~]# ip r l|cut -d '.' -f1-3|sort
10.10.0
10.10.0
10.10.1
10.10.1
10.10.2
10.10.2
10.10.3
10.10.3
10.10.4
10.10.4
10.10.5
10.10.5
10.10.6
10.10.6
10.10.7
10.10.7
10.10.8
10.10.8
10.10.9
10.10.9
169.254.0
221.62.32
default via 209.62.32
root@tester [~]# ip r l|cut -d '.' -f1-3|sort |uniq -c
2 10.10.0
2 10.10.1
2 10.10.2
2 10.10.3
2 10.10.4
2 10.10.5
2 10.10.6
2 10.10.7
2 10.10.8
2 10.10.9
1 169.254.0
1 221.62.32
1 default via 221.62.32
root@tester [~]#
</pre>
cut
tr
sort
uniq
head
tail
wc
awk
<pre>
root@tester [~]# ip r l
10.10.3.25 dev eth0 scope link src 10.10.3.25
10.10.1.25 dev eth0 scope link src 10.10.1.25
10.10.7.25 dev eth0 scope link src 10.10.7.25
10.10.5.25 dev eth0 scope link src 10.10.5.25
10.10.9.25 dev eth0 scope link src 10.10.9.25
10.10.2.25 dev eth0 scope link src 10.10.2.25
10.10.0.25 dev eth0 scope link src 10.10.0.25
10.10.6.25 dev eth0 scope link src 10.10.6.25
10.10.4.25 dev eth0 scope link src 10.10.4.25
10.10.8.25 dev eth0 scope link src 10.10.8.25
10.10.6.0/24 dev eth0 proto kernel scope link src 10.10.6.25
10.10.7.0/24 dev eth0 proto kernel scope link src 10.10.7.25
221.62.32.0/24 dev eth0 proto kernel scope link src 221.62.32.14
10.10.4.0/24 dev eth0 proto kernel scope link src 10.10.4.25
10.10.5.0/24 dev eth0 proto kernel scope link src 10.10.5.25
10.10.2.0/24 dev eth0 proto kernel scope link src 10.10.2.25
10.10.3.0/24 dev eth0 proto kernel scope link src 10.10.3.25
10.10.0.0/24 dev eth0 proto kernel scope link src 10.10.0.25
10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.25
10.10.8.0/24 dev eth0 proto kernel scope link src 10.10.8.25
10.10.9.0/24 dev eth0 proto kernel scope link src 10.10.9.25
169.254.0.0/16 dev eth0 scope link
default via 221.62.32.1 dev eth0
root@tester [~]# ip r l|cut -d '.' -f1-3|sort
10.10.0
10.10.0
10.10.1
10.10.1
10.10.2
10.10.2
10.10.3
10.10.3
10.10.4
10.10.4
10.10.5
10.10.5
10.10.6
10.10.6
10.10.7
10.10.7
10.10.8
10.10.8
10.10.9
10.10.9
169.254.0
221.62.32
default via 209.62.32
root@tester [~]# ip r l|cut -d '.' -f1-3|sort |uniq -c
2 10.10.0
2 10.10.1
2 10.10.2
2 10.10.3
2 10.10.4
2 10.10.5
2 10.10.6
2 10.10.7
2 10.10.8
2 10.10.9
1 169.254.0
1 221.62.32
1 default via 221.62.32
root@tester [~]#
</pre>
Последна модификация: Sunday, 11 November 2012, 06:25 PM