How to Install CR/LF & Unix/DOS in Cygwin
- 1). Log in to the computer as a Windows Administrator.
- 2). Click "Start," type "run" into the search box and click "Run." Type "cmd" and press "Enter." A new command window will come up.
- 3). Type the following command into the command window:
setup.exe -P cygutils
Press "Enter." Cygwin will install a new package, cygutils, that contains the file-conversion tools. - 4). Type the following command into a Cygwin window to convert a file from the Windows format to the Unix format:
dos2unix winFile.txt unixFile.txt
Replace "winFile.txt" with the name of the file you want to convert. Press "Enter." - 5). Type the following command into a Cygwin window to convert a file from the Unix format to the Windows format:
dos2unix unixFile.txt winFile2.txt
For the example, "winFile.txt" and "winFile2.txt" will end up having exactly the same contents after the conversion to Unix and back to Windows.
Source...