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:

  • Apachetop As a webmaster, I’ve often wanted to be able to see real-time hits as they arrive. Sure, Google Analytics is a wonderful package for looking at trends over time, but there’s a delay of a few hours there, and you really can’t… Read More
  • Install PHP 5.4 and MySQL 5.5 in CentOS 6.4 via Yum How about default? For example, look at PHP version. CentOS $ yum info php Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.sin3.sg.voxel.net * extras: mirrors.sin3.sg.voxel.net … Read More
  • Understanding and using htop to monitor system resources Every so often there will be something that slows a system down. There are a few tools that can help to identify which process is the cause of this slow down. One such tool is htop. Htop is an interactive and real time proce… Read More
  • Cấu hình mod caching trên nginx A. Name-based virtual servers Nginx sẽ quyết định server block nào sẽ xử lý khi một request tới. Chẳng hạn như ta có các dòng config sau: server { listen       80; serv… Read More
  • Load Test and Benchmark your web application using Siege Developers are always worried about how their web application will perform to the real world users. Once the site is rolled out; it may come down due to sudden surge in its use, depicting DoS (Denial of Service) attack. Woul… Read More