7

I want to use dos2unix so I installed the tofrodos package, but it still says dos2unix: command not found.

So I ran:

apt-file update; apt-file search dos2unix

And it gives zero result.

Where is dos2unix in Ubuntu 20.04? Has it been replaced by an equivalent utility?

gronostaj
  • 55,965
  • 20
  • 120
  • 179
Nicolas Raoul
  • 10,711
  • 18
  • 64
  • 102

2 Answers2

12

From the description of the package tofrodos in synaptic:

Tofrodos comprises one program, "fromdos" alias "todos", which converts text files to and from these formats. Use "fromdos" to convert DOS text files to the Unix format, and "todos" to convert Unix text files to the DOS format.

What is wrong with dos2unix and unix2dos is beyond me, and I think it is unbelievable that the package doesn't even make aliases for people who have used linux before and expect dos2unix and unix2dos.

Neal
  • 8,748
  • 1
  • 28
  • 33
  • 2
    And another thing... If the idea is that "fromdos" and "todos" are more friendly than "unix2dos" and "dos2unix" why on earth is the package called "tofordos"? – Neal Jul 20 '10 at 07:40
  • You can do this if you want to: `username@linuxbox:/usr/bin# sudo ln -s fromdos dos2unix username@linuxbox:/usr/bin# sudo ln -s todos unix2dos` – Alexander Bird Sep 20 '12 at 22:24
  • I think the todos/fromdos tools allow for in-place editing of a file, and thus, can be easily included into the "external commands" menu of some GUI-based text editors. With dos2unix a tempfile was needed. – knb Jul 10 '13 at 19:49
2

Where is dos2unix in Ubuntu 2010.04?

On Ubuntu 20.04+, use the Advanced Packaging Tool (APT) to install dos2unix :

sudo apt install -y dos2unix

To find out where it's installed, I ran which dos2unix, which yielded /usr/bin/dos2unix.

Henke
  • 813
  • 1
  • 8
  • 20