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字节,因此将其视为一条记录.
归档时间: |
|
查看次数: |
482 次 |
最近记录: |