标签:
[root@elk_m ~]# awk ‘{print $0}‘ install.log.syslog |head -1
<86>Feb 29 02:58:28 groupadd[1598]: group added to /etc/group: name=dbus, GID=81
不想要的话就$num="" 并用分号结尾
[root@elk_m ~]# awk ‘{$2="";print $0}‘ install.log.syslog |head -1
<86>Feb 02:58:28 groupadd[1598]: group added to /etc/group: name=dbus, GID=81
for循环打印列
[root@elk_m ~]# awk ‘{for(i=2;i<NF;i++)printf("%s ",$i);printf("\n")}‘ install.log.syslog |head -1
29 02:58:28 groupadd[1598]: group added to /etc/group: name=dbus,
标签:
原文地址:http://www.cnblogs.com/liujianzuo888/p/5230573.html