This program converts line endings of text files between MS-DOS and **IX formats. It detects binary files in a nearly foolproof way and leaves them alone unless you override this. It will also leave files alone that are already in the right format and preserves file timestamps. User interrupts are handled gracefully and no garbage or corrupted files left behind. ‘flip' does not convert files to a different character set, and it can not handle Apple Macintosh line endings (CR only). For that (and more), you can use the ‘recode' program (package ‘recode').
Install flip in debian
#apt-get install flip
This will complete the installation.
flip -umvtsbz file
-u convert to **IX format (CR LF => LF, lone CR or LF unchanged, trailing control Z removed, embedded control Z unchanged)
-m convert to MS-DOS format (lone LF => CR LF, lone CR unchanged)
-h give a help message
-v be verbose, print filenames as they are processed
-t touch files (don't preserve timestamps)
-s strip high bit
-b convert binary files too (else binary files are left unchanged)
-z truncate file at first control Z encountered
file.txt is a dos file with ^Ms at the end of each line.
file.txt: ASCII text, with CRLF, LF line terminators
1)flip -u file.txt
file.txt: ASCII text
Again converting to dos format
2) flip -m file.txt
file.txt: ASCII text, with CRLF line terminators
This command is also called alternative to dos2unix,unix2dos commands