• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dos2unix: command not found

by admin

dos2unix command converts files using the DOS extended character set to their ISO standard counterparts. If dosfile and unixfile are the same, the file is overwritten after the conversion is done.

dos2unix Command Options

Option Description
-cmode, –convmodemode Set the conversion mode to mode. Possible values are ASCII, 7bit ISO, and Mac. The default is ASCII.
-h,–help Print a command-line summary and exit.
-k, –keepdate Make the modification date of the output file be the same as that of the input file.
-ninfile outfile …, –newfileinfile outfile … New file mode. Filenames must be provided in pairs: the first one is the input file, the second is the output file.
-ofile…;–oldfilefile… Old file mode. Each input file in converted in place. This is the default.
-q, –quiet Do not print any warnings or messages.
-V, –version Print version information and exit.

If you encounter the below error while running dos2unix command:

dos2unix: command not found

you may try installing the dos2unix as shown below as per your choice of distribution:

Distribution Command
OS X brew install dos2unix
Debian apt-get install dos2unix
Ubuntu apt-get install dos2unix
Alpine apk add dos2unix
Arch Linux pacman -S dos2unix
Kali Linux apt-get install dos2unix
CentOS yum install dos2unix
Fedora dnf install dos2unix
Raspbian apt-get install dos2unix

dos2unix Command Examples

1. Change the line endings of a file:

$ dos2unix filename

2. Create a copy with Unix-style line endings:

$ dos2unix -n filename new_filename

Filed Under: Linux

Some more articles you might also be interested in …

  1. cpio Command Examples in Linux
  2. How to Run DNS and FTP services in a chroot Jail
  3. How to use netstat command under Linux (Examples included)
  4. jcal Command Examples
  5. qtchooser Command Examples in Linux
  6. lsb_release: command not found
  7. needrestart: command not found
  8. eject: command not found
  9. which: command not found
  10. sinfo Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright