debian dos2unix

debian系统打开Windows下生成的文本文件,会在每行的末尾出现’^M’

原因就是Windows和Linux的回车符是不同的

在Windows下回车符是\r\n回车换行

在Linux下回车符是\n

最简单、最常用的解决方法是使用dos2unix命令转换:dos2unix filename

debian下dos2unix和unix2dos命令在tofrodos包中

安装:apt-get install tofrodos

安装完之后用dos2unix和unix2dos发现还是不能用,原来是debian里已经不再用这个命令啦,

$ dpkg -L tofrodos
/.
/usr
/usr/bin
/usr/bin/fromdos
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/fromdos.1.gz
/usr/share/doc
/usr/share/doc/tofrodos
/usr/share/doc/tofrodos/NEWS.Debian.gz
/usr/share/doc/tofrodos/tofrodos.html
/usr/share/doc/tofrodos/copyright
/usr/share/doc/tofrodos/changelog.Debian.gz
/usr/share/doc/tofrodos/readme.txt.gz
/usr/bin/todos
/usr/share/man/man1/todos.1.gz
可以看出,改成todos和fromdos了

转载于:https://www.cnblogs.com/yuanping/archive/2013/06/10/3130801.html

猜你喜欢

转载自blog.csdn.net/weixin_34353714/article/details/94067264