Install dos2unix in Ubuntu

Source: Internet
Author: User
By default, the dos2unix tool is not installed in Ubuntu, and there is no tool named this name (I have used dos2unix in solaris, but I don't know why Ubuntu does not ). However, there is an alternative tool, tofrodos. Next we will talk about its installation and use. Of course, it is still apt installation. (1) install tofrodossudoapt-getinstalltofrodos. In fact, it installs two tools: todos (equivalent to unix2dos)

By default, the dos2unix tool is not installed in Ubuntu, and there is no tool named this name (I have used dos2unix in solaris, but I don't know why Ubuntu does not ). However, there is an alternative tool, tofrodos. Next we will talk about its installation and use.
Of course, it is still apt installation.

(1) install tofrodos
Sudo apt-get install tofrodos
In fact, it installs two tools: todos (equivalent to unix2dos) and fromdos (equivalent to dos2unix)
After installation, you can convert the text format.
For example, todos Hello.txt (unix2dos Hello.txt)
Fromdos Hello.txt (dos2unix Hello.txt)

(2) Make some optimizations
As you get used to unix2dos and dos2unix commands, you can link the two tools installed above to unix2dos and dos2unix, or just create an alias 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 in ~ /. Alias in bashrc
Vi ~ /. Bashrc
Add alias unix2dos = todos alias dos2unix = fromdos

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.