2009年8月22日星期六

在Linux下将windows文本格式转换为UNIX格式

转:

在Linux下有一下这两条命令:unix2dos 和dos2unix
下面是演示:

[root@wwwtest ~]# cat -vt test
1
2
3
45
6
[root@wwwtest ~]# unix2dos test
unix2dos: converting file test to DOS format …
[root@wwwtest ~]# cat -vt test
1^M
2^M
3^M
45^M
6^M
^M

[root@wwwtest ~]# dos2unix test
dos2unix: converting file test to UNIX format …
[root@wwwtest ~]# cat -vt test
1
2
3
45
6

--
陈永林 <vnresearch@gmail.com>

没有评论: