码迷,mamicode.com
首页 > 其他好文 > 详细

dos2unix用法

时间:2014-05-10 06:08:31      阅读:370      评论:0      收藏:0      [点我收藏+]

标签:des   ext   c   int   get   a   

windows下编写的脚本,上传到linux上执行,有时会出现莫名其妙的结果,也是折腾了半天才找出原因,windows和linux有些编码不同,经dos2unix处理后,结果一切正常
man dos2unix结果如下,英文不难理解,一看就基本懂,所以也懒得翻译了
NAME
       dos2unix - DOS/MAC to UNIX text file format converter

SYNOPSYS
       dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...]

       Options:

       [-hkqV] [--help] [--keepdate] [--quiet] [--version]

DESCRIPTION
       This  manual page documents 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 program 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 lose 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

dos2unix用法,布布扣,bubuko.com

dos2unix用法

标签:des   ext   c   int   get   a   

原文地址:http://www.cnblogs.com/dytl/p/3719445.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!