#1.awk的搜索功能
ifconfig |awk ‘/Bc/‘|awk -F: ‘{print $2}‘|awk ‘{print $1}‘
#2.cut指定分割符
ifconfig |sed -n 2p|cut -d : -f2|cut -d " " -f1
#3.head,tail命令结合很方便
ifconfig |head -2 |tail -1|sed ‘s#^.*dr:\(.*\) Bca.*$#\1#‘
#4.sed的替换功能
ifconfig |sed -n 2p|sed ‘s#^.*dr:\(.*\) B.*$#\1#g‘
#5.grep过滤指定的行
ifconfig |grep "Bcast"|cut -c 21-36
#6.cut命令的-c选项应用
ifconfig |awk ‘NR==2{print $2 }‘|cut -c 6-
#7.awk的打印行号的功能
ifconfig |awk ‘NR==2{print $2 }‘|cut -d ":" -f2
#8.sed的删除功能和tr的替换功能
ifconfig |sed ‘3,$d‘|sed 1d|tr ":" "\n"|grep B|tr " " "\n"|head -1
#9.tr随意替换,想替换成什么,就替换成什么
ifconfig |sed -n 2p|tr "Bcast" ":Bcas"|cut -d : -f2
#10.awk的搜索功能加tr的替换功能
ifconfig |awk ‘/Bc/‘|tr "B" ":"|cut