`

dos2unix 命令

    博客分类:
  • OS
 
阅读更多
  这是一个很简单的命令.功能是将DOS/MAC下的文件转化为UNIX的文本文件格式.用法详见下面.
就是这样一个简单的命令折腾了我大半天.我在用mysql查询数据库,执行的批处理放在了一个文件里.如果我执行这个文件,那个存放查询结果的文件名字总是在后面附加一个?号.而如果我一行一行敲入命令,执行就正常.而且比较了两个文件后没有差别.还有一个奇怪的事情就是总是出现一个类似"quit"出现mysql语法错误的提示.这个奇怪的现象使我很困惑.后来在一位老大的帮助下想到了是不是由于文件格式的差别.因为我这个文件在windows下编辑过,后来一试,果然很灵啊.

SYNOPSYS
       dos2unix  [options] [-c convmode] [-o file ...] [-n infile outfile ...]
       Options:
       [-hkqV] [--help] [--keepdate] [--quiet] [--version]
DESCRIPTION
       dos2unix, the program  that  converts  plain
       text files in DOS/MAC format to UNIX format.
OPTIONS
       The following options are available:
       -h --help
              Print online help.
       -k --keepdate
              Keep the date stamp of output file same as input file.
       -q --quiet
              Quiet mode. Suppress all warning and messages.
       -V --version
              Prints version information.
       -c --convmode convmode
              Sets  conversion  mode.  Where  convmode is one of: ASCII, 7bit,
              ISO, Mac with ASCII being the default.  Simulates dos2unix under
              SunOS.
       -o --oldfile file ...
              Old file mode. Convert the file and write output to it. The pro-
              gram default to run in this mode. Wildcard names may be used.
       -n --newfile infile outfile ...
              New file mode. Convert the infile and write output  to  outfile.
              File  names must be given in pairs and wildcard names should NOT
              be used or you WILL lost your files.
EXAMPLES
       Get input from stdin and write output to stdout.
              dos2unix
       Convert and replace a.txt. Convert and replace b.txt.
              dos2unix a.txt b.txt
              dos2unix -o a.txt b.txt
       Convert and replace a.txt in ASCII conversion mode.
              dos2unix a.txt -c iso b.txt
       Convert and replace b.txt in ISO conversion mode.
              dos2unix -c ascii a.txt -c iso b.txt
       Convert c.txt from Mac to Unix ascii format.
              dos2unix -c mac c.txt b.txt
       Convert and replace a.txt while keeping original date stamp.
              dos2unix -k a.txt
              dos2unix -k -o a.txt
       Convert a.txt and write to e.txt.
              dos2unix -n a.txt e.txt
       Convert a.txt and write to e.txt, keep date  stamp  of  e.txt  same  as
       a.txt.
              dos2unix -k -n a.txt e.txt
       Convert and replace a.txt. Convert b.txt and write to e.txt.
              dos2unix a.txt -n b.txt e.txt
              dos2unix -o a.txt -n b.txt e.txt
       Convert  c.txt  and write to e.txt. Convert and replace a.txt.  Convert
       and replace b.txt. Convert d.txt and write to f.txt.
              dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt
分享到:
评论

相关推荐

    使用python实现unix2dos和dos2unix命令的例子

    由于工作电脑网络限制无法安装unix2dos和dos2unix命令转换文件,自己实现一个 直接上代码,保存为python文件如unix2dos.py然后使用命令 unix2dos.py {unix2dos|dos2unix} {dirname|filename} #! /usr/bin/env ...

    dos2unix命令 将DOS格式的文本文件转换成UNIX格式

    dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter)。DOS下的文本文件是以\r\n作为断行标志的,表示成十六进制就是0D 0A。而Unix下的文本文件是以\n作为断行标志...

    dos2unix-6.0.3-4.el7.x86_64.rpm

    dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的

    dos2unix.zip

    linux中没有dos2UNIX命令怎么解决办法,dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter)。DOS下的文本文件是以\r\n作为断行标志的,表示成十六进制就是0D 0A。...

    dos2unix-6.0.3-7.el7.x86_64.rpm.7z

    dos2unix命令用来将DOS格式的文本文件转换成UNIX格式 最简单的用法就是dos2unix直接跟上文件名:dos2unix file -k:保持输出文件的日期不变 -q:安静模式,不提示任何警告信息。 -V:查看版本 -c:转换模式,模式有...

    DOS、UNIX 经典命令集锦

    DOS、UNIX 经典命令集锦.rarDOS、UNIX 经典命令集锦.rar

    dos to unix

    dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter)

    [原创]unix2dos dos2unix 批量 windows升级版

    unix2dos批量转换工具(双向) MS桌面版 前一版描述较不祥细,以至于很同朋友不知道可以选择多个文件拖放,故在此多啰嗦几句。 注明:1、窗口支持拖放,单文件或多文件同时拖放均可 2、新版本添加文件列表窗口中点...

    unix2dos dos2unix 文件格式转换

    unix2dos/u2d unix转换成windows格式命令 dos2unix/d2u windows转换成unix格式命令 getclip 获取剪贴板内容 putclip 写入剪贴板内容

    windows下UNIX2DOS

    unix2dos 操作环境:Microsoft桌面操作系统/dos下操作 使用方法:拖放要转换的文本文件至输入窗口中,选择要转换的方式(DOS2UNIX或UNIX2DOS),点转换即可直接转换 注:支持命令提示符下参数操作 功能: unix...

    Dos To Unix

    Dos To Unix 编码转换工具

    tofrodos_1.7.8.debian.1-1_amd64.deb

    最简单、最常用的解决方法是使用dos2unix命令转换:dos2unix filename Ubuntu下dos2unix和unix2dos命令在tofrodos包中 安装:apt-get install tofrodos 安装完之后用dos2unix和unix2dos发现还是不能用,原来是...

    dos、unix 经典命令集锦

    dos、unix 经典命令集锦

    ubuntu系统x64 tofrodos deb安装包

    在跨平台中,windows换行符通常为\r\n, 而linux下则为\n,这就导致了在windows下编写的文件上传到linux中时,vim打开文件后,在行末总能看到^M这样的字样,解决这一问题的...然后unix2dos和dos2unix命令你就可以使用啦

    unix-dos 文本转换工具

    1、由于windows平台与linux平台下的换行符不同,因此在不同平台间传送文件时,因经过转换,此工具即实现了此功能。 2、此资源包文件列表如下: a) unix2dos.c #unix2dos源... #命令格式:dos2unix <源文件> <目标文件>

    linux的unix2dos的安装包

    只要下载该安装包然后执行rpm -ivh unix2dos-2.2-35.el6.x86_64.rpm 以后就可以在linux下执行unix2dos命令

    unix2dos工具批量转换

    unix2dos 批量转换 纯绿色 操作环境:Microsoft桌面操作系统/dos下操作 使用方法:拖放要转换的文本文件至输入窗口中,选择要转换的方式(DOS2UNIX或UNIX2DOS),点转换即可直接转换 注:支持命令提示符下参数...

    VC++Dos 命令接口2(操作系统课程设计)

    设计任务 (1)为Windows操作系统建立兼容的DOS命令接口,文件与目录命令 (2)具体命令:DIR,RD,CD,MD,DEL,MOVE,REN,XCOPY,命令格式可参考Windows的CMD.EXE或MS-DOS提供的命令格式 (3)设计命令的名称,参数等...

Global site tag (gtag.js) - Google Analytics