Wednesday, December 18, 2013

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. 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 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. Convert and replace b.txt in ISO conversion mode. Convert c.txt from Mac to Unix ascii format.

dos2unix a.txt -c iso b.txt

dos2unix -c ascii a.txt -c iso b.txt

dos2unix -c mac a.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

Related Posts:

  • Daemon Showdown: Upstart vs. Runit vs. Systemd vs. Circus vs. God We write a lot of daemons : programs which run on servers in the background, like an HTTP server, or a database. Once we've written the programs, though, we have to run them, and running programs as daemons is surp… Read More
  • Introducing vtop — A Terminal Activity Monitor in Node.js Command-line tools like “top” make it difficult to see CPU usage across multi-process applications (like Apache and Chrome), spikes over time, and memory usage. That’s why we created vtop. Vtop is a free and open so… Read More
  • RPM Command: 15 Examples to Install, Uninstall, Upgrade, Query RPM Packages RPM command is used for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Linux system. RPM stands for Red Hat Package Manager. With root privilege, you can use the rp… Read More
  • Vps config install vim # apt-get install libncurses5-dev python-dev # wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 -O /data/vim-7.4.tar.bz2 # cd /data/ && tar jxf vim-7.4.tar.bz2 # cd vim74 && ./config… Read More
  • Beanstalkd What is an asynchronous queue The classic wikipedia quote (Message queue) In computer science, message queues and mailboxes are software-engineering components used for interprocess communication, or for inter-thread… Read More