一、uniq
uniq用于去除连续的重复行
常见选项:
-i: 忽略大小写
-c: 统计重复行次数
-d:只显示重复行
举例说明:
# uniq test.txt
# uniq -d test.txt
# uniq -dc test.txt
二、tee
tee工具是从标准输入读取并写入到标准输出和文件,即:双向覆盖重定向(屏幕输出|文本输入)
选项:
-a 双向追加重定向
# echo hello world
# echo hello world|tee file1
# cat file1
# echo 999|tee -a file1
# cat file1