Dos2unix is not installed by default under Ubuntu, and of course we can install it via the sudo apt-get install Dos2unix .
In addition, in the absence of Dos2unix, we can also use another software replacement-Tofrodos, the following describes the use and installation of the software.
(1) Install with apt command on Ubuntu
sudo apt-get install Tofrodos
In fact it installs two tools:todos(equivalent to Unix2dos), and Fromdos(equivalent to Dos2unix)
After the installation, you can now convert the text format.
Like what:
Todos Hello.txt (i.e. Unix2dos Hello.txt)
Fromdos Hello.txt (i.e. Dos2unix Hello.txt)
(2) do some optimization
accustomed to the commands of Unix2dos and Dos2unix, you can link the two tools installed above into Unix2dos and Dos2unix, or just an individual name, and put it in the startup script.
steps:
ln-s/usr/bin/todos/usr/bin/unix2dos
ln-s/usr/bin/fromdos/usr/bin/dos2unix
or an individual name in ~/.BASHRC .
VI ~/.BASHRC
Add alias Unix2dos=todos
Alias Dos2unix=fromdos
This article is from the "5311" blog, please be sure to keep this source http://cuis1.blog.51cto.com/8805022/1877473
Linux under Dos2unix