Linux下去掉Windows的^M的方法

转自: https://blog.csdn.net/shouldnotappearcalm/article/details/64904253

 

命令:

  • dos2unix filename
  • sed -i 's/^M//g' filename
  • :1,$ s/^M//g
  • cat filename |tr -d ‘/r’ > newfile 

说明如图:

 

posted @ 2018-09-08 16:32  sunzebo  阅读(400)  评论(0编辑  收藏  举报