摘要: AWK 1.begin end使用 cat /tmp/passwd |awk -F ':' 'BEGIN {print "hello"} {print $1"\t"$3} END {print "ending"}' 2.匹配 [root@zeus tmp]# cat /tmp/passwd |awk 阅读全文
posted @ 2019-06-21 09:45 朤尧 阅读(475) 评论(0) 推荐(0) 编辑
摘要: sed 列出5-7行 [root@www ~]# nl /etc/passwd | sed -n '5,7p' -n不在处理前打印,搜索root,/p打印 nl /etc/passwd | sed '/root/p' 举例:(假设我们有一文件名为ab) 删除某行 [root@localhost ru 阅读全文
posted @ 2019-06-21 09:43 朤尧 阅读(370) 评论(0) 推荐(0) 编辑