Linxu中和Windows中的文本格式

在Linux中新建的文本文件换行符是$

Windows中新建的文本换行符是^M$

在Windows中编辑由Linux中创建的文本,新添加的内容仍然会以Linux的$的格式换行

可以用file命令大概看一下文件的属性

[oracle@localhost test_move]$ file test.txt    
test.txt: ASCII text, with CRLF line terminators    //Windows下的格式
[oracle@localhost test_move]$ file stu.dat
stu.dat: ASCII text                //Linux下的格式

将Windows下编辑的文本转换成Linux中的文本格式可以使用命令:dos2unix 文件名

posted @ 2017-05-10 20:39  太古丶凶兽  阅读(133)  评论(0编辑  收藏  举报