Jim*_*Jim 1 unix linux shell cygwin uniq
我有文件sorted.txt:
$cat sorted.txt
bash
fosh
hack
hack
Run Code Online (Sandbox Code Playgroud)
如果我这样做uniq:
$uniq sorted.txt
bash
fosh
hack
Run Code Online (Sandbox Code Playgroud)
如果我这样做,uniq -z我得到:
$uniq -z sorted.txt
bash
fosh
hack
hack
Run Code Online (Sandbox Code Playgroud)
即uniq -z我在复制!我期待,在输出唯一的区别uniq sorted.txt和uniq -z sorted.txt是分隔符.
我为什么要重复uniq -z?
该-z选项告诉uniq使用0字节而不是换行作为记录之间的分隔符.由于您的文件没有任何0字节,因此将其视为一条记录.