Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Dos2unix under linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Dos2unix is not installed by default under ubuntu. Of course, we can install it through sudo apt-get install dos2unix.

In addition, in the absence of dos2unix, we can also use another software to replace-tofrodos, the following describes the use and installation of this software.

(1) use apt command to install on ubuntu

Sudo apt-get install tofrodos

It actually installs two tools: todos (equivalent to unix2dos) and fromdos (equivalent to dos2unix)

After installation, you can now convert the text format.

For example:

Todos Hello.txt (i.e. unix2dos Hello.txt)

Fromdos Hello.txt (i.e. dos2unix Hello.txt)

(2) do some optimization.

Because you are used to the commands of unix2dos and dos2unix, you can link the two tools installed above into unix2dos and dos2unix, or just give them individual names and put them in the startup script.

Steps:

Ln-s / usr/bin/todos / usr/bin/unix2dos

Ln-s / usr/bin/fromdos / usr/bin/dos2unix

Or give a different name in ~ / .bashrc

Vi / .bashrc

Add alias unix2dos=todos

Alias dos2unix=fromdos

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report