Linux下去掉^M的方法
来源:互联网 发布:成都文殊院网络素食 编辑:程序博客网 时间:2024/06/16 18:24
原文地址:http://blog.csdn.net/shouldnotappearcalm/article/details/64904253
昨天在登陆云服务器时候报错。
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
后面发现是自己傻逼的把profile在windows上写了传上去的。
用/bin/cat -v /etc/profile看到很多^M,是因为Windows下的换行符的原因。
现在在linux下面删了就行,我用的第一种方法。
第一种方法(先yum install -y dos2unix):
cat -A filename 就可以看到windows下的断元字符 ^M
要去除他,最简单用下面的命令:
- 1
第二种方法:
- 1
注意:^M的输入方式是 Ctrl + v ,然后Ctrl + M
第三种方法:
vi filename
:1,$ s/^M//g
^M 输入方法: ctrl+V ,ctrl+M
第四种方法:
cat filename |tr -d ‘/r’ > newfile
^M 可用 /r 代替
阅读全文
0 0
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- Linux下去掉^M的方法
- linux下去掉文件中^M的方法
- linux下去掉文件中^M的方法
- linux下去掉文件中^M的方法
- linux 下去掉^M
- VC++中,如何定义callback函数和它的触发事件?
- FastDFS分布式文件系统
- 面向对象程序设计上机练习六(类和对象)
- hashTable与布隆过滤器(Bloom Filter)初识
- Android中打开本地doc、pdf、ppt、text等文件功能的实现
- Linux下去掉^M的方法
- 这是我的第一篇csdn博客
- [Android][第一行代码][第 8 章 多媒体]
- 欢迎使用CSDN-markdown编辑器
- AIX下更换rootvg磁盘与DIAG工具定位故障磁盘
- 全屏设置
- python 创建类cell数组
- redis持久化的配置
- EditPlus_3.4及注册码