文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>dos2unix, unix2dos 对应的命令

dos2unix, unix2dos 对应的命令

时间:2006-07-21  来源:linxh

dos2unix, unix2dos 用来实现 DOS <=> UNIX text file 转换
aptitude install sysutils

行末:
DOS 格式 0d 0a
UNIX 格式 0a

可用功能相同的指令組合
dos2unix:
sed -i'' "s/\r//" file

cat file | col -b > newfile

cat file | tr -d "\r" > newfile

cat file | tr -d "\015" > newfile

unix2dos:
sed -i'' "s/$/\r/" file

sed -i'' "s/$/\x0d/" file

-i后面的是单引号组成

以上适用 GNU sed, FreeBSD 下的 sed 不适用

相关阅读 更多 +
排行榜 更多 +
滑动贴合3d

滑动贴合3d

休闲益智 下载
红蓝人冰火世界

红蓝人冰火世界

休闲益智 下载
阿凡提跑酷最新版

阿凡提跑酷最新版

冒险解谜 下载