UNIX系统常用命令
{ if ( $2 < 10000 ) t_0 += $2;
if ( $2 > 10000 && $2 < 50000) t_10 += $2;
if ( $2 > 50000 && $2 < 100000) t_50 += $2;
if ( $2 > 100000) t_100 += $2;
total += $2 }
END {printf "t_0 = %dKB %5.2f\%\n",t_0,t0*100/total;
printf "t_10 = %dKB %5.2f\%\n",t_10,t10*100/total;
printf "t_50 = %dKB %5.2f\% \n",t_50,t_50*100/total;
printf "t_100 = %dKB %5.2f\%\n",t_100,t_100*100/total;
printf "Total = %dKB\n", total}
#End of traffic.awk
17. 网络配置命令及故障排除命令
17.1 ifconfig
Interface Config , 网卡配置命令, 相关文件:/proc/net/dev
详细使用说明: man ifconfig
示例:
#ifconfig
lo Link encap:Local Loopback
网卡标识 封装类型: 本地回环
inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0
IP地址:127.0.0.1 广播地址:127.255.255.255 子网掩码:255.0.0.0
UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1
已启动 接受广播 本地回环 正在运行 最大传输单元: 3584 路由距离向量:1
RX packets:718 errors:0 dropped:0 overruns:0 frame:0
已接受数据包:718
TX packets:718 errors:0 dropped:0 overruns:0 carrier:0
已发送数据包:718
collisions:0
碰撞:0
eth0 Link encap:Ethernet HWaddr 00:80:C8:4C:6A:D0
网卡标识 封装类型: Ethernet 硬件(MAC)地址: 00:80:C8:4C:6A:D0

