Title: dos2unix - unix2dos
Course: Introduction to SSL/PKI > Section: Miscellaneous

dis2unix - unix2dos

Introduction

Window and linux/unix systems have incompatible text file formats.

Liux/unix uses a line break (newline) as a line seperator.

Windows (dos) uses a carriage return and line break (newline) as a line seperator.

dos2unix and unix2dos can convert from one th the other

For more information see the command's man pages.

Installing dos2unix and unix2dos Commands

To install the commands on Ubuntu, enter the following commands in a command window.

$ sudo apt-get install dos2unix
$ sudo apt-get install unix2dos


Note: These commands are also available for Window and MAC systems.

Using The Commands

Convert a dos text file to a liunx/unix text file.

$ dos2unix abc.txt

Convert a linux/unix text file to a dos text file.

$ unix2dos xyz.txt

The commands have more capabilities. See the command documentation for more information.