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



posted on 2011-12-18 16:30  wangbokun  阅读(255)  评论(0编辑  收藏  举报

导航