tr
tr [options] source-char-list replace-char-list
现随便写一个test
root@ubuntu:~# cat test.txt
asdf
dsgr th
#dfg
sdfgthsdf
gdfg
然后使用tr效果如下
root@ubuntu:~# tr -cd '\r' < test.txt > atest.txt
root@ubuntu:~# cat atest.txt
root@ubuntu:~# tr -cs '\r' < test.txt > atest.txt
root@ubuntu:~# cat atest.txt
asdf
dsgr th
#dfg
sdfgthsdf
gdfg
浙公网安备 33010602011771号