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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. CentOS / RHEL 7 : Beginners guide to systemd targets (replacement of SysV init run levels)
  2. make: command not found
  3. srun Command Examples in Linux
  4. whatis Command Examples in Linux
  5. terminator Command Examples in Linux
  6. How to Configure SSH to restrict Users/Groups with allow and deny directives
  7. dkms: command not found
  8. How to configure resource groups for MySQL Server running on Linux
  9. apt-key Command Examples in Linux
  10. How to extract RPM package without installing it

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright