cut 与 awk
时间:2015-05-22 19:01:59
收藏:0
阅读:194
cut和awk都能分割显示需要的内容
但在需要以空格为分隔符的情况下:
# free -m|grep Mem Mem: 1010 657 353 0 70 428
cut是以单一空格为分隔符的:
# free -m|grep Mem|cut -d‘ ‘ -f11 1010
awk是以单个或连续的空格为分隔符的:
# free -m|grep Mem|awk ‘{print $2}‘ 1010
原文:http://www.cnblogs.com/tuokid/p/4522873.html
评论(0)