1. 文本处理

删除奇数行

cat -n /etc/passwd | sed '1~2d'
cat -n /etc/passwd | awk 'NR%2==0'

删除偶数行

cat -n /etc/passwd | sed '1~2!d'
cat -n /etc/passwd | awk 'NR%2==1'
Copyright © book.bbxyard.com 2014-2019 all right reserved,powered by Gitbook该文件修订时间: 2019-07-14 10:48:57

results matching ""

    No results matching ""