If you've ever tried to run a shell script on Linux only to see cryptic \r: command not found errors, you’ve encountered a line-ending mismatch. Windows uses (Carriage Return + Line Feed), while Linux and macOS use LF (Line Feed). The dos2unix utility is the standard tool to bridge this gap. What is dos2unix?
dos2unix is a command-line tool that converts text files from DOS/Windows format to Unix format. It effectively removes hidden "hidden" Windows characters (like ^M ) that can break scripts, configuration files, and code compilers. download and install dos2unix
On Debian-based systems, dos2unix is available in the standard repositories. sudo apt update && sudo apt install dos2unix 2. Linux (CentOS, RHEL, Fedora) Red Hat-based distributions use yum or dnf . CentOS/RHEL: sudo yum install dos2unix Fedora: sudo dnf install dos2unix 3. macOS Dos2Unix: Windows-Unix File Transfers If you've ever tried to run a shell
Depending on your operating system, use the following commands to download and install the package. What is dos2unix