dos2unix
« Back to VersTracker
Description:
Convert text between DOS, UNIX, and Mac formats
Type: Formula  |  Latest Version: 7.5.3@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: text-processing file-conversion cli cross-platform developer-tools
Install: brew install dos2unix
About:
dos2unix is a command-line utility designed to convert plain text files between DOS/Windows, UNIX/Linux, and Mac line ending formats. It handles the transformation of CR+LF (Carriage Return + Line Feed) sequences to and from the LF (Line Feed) standard used on Unix-like systems. This ensures cross-platform compatibility for scripts, configuration files, and source code.
Key Features:
  • Batch conversion of multiple files and directories
  • Preserves original file timestamps or updates them as needed
  • In-place file modification with optional backup creation
  • Handles mixed-format files gracefully
Use Cases:
  • Fixing shell scripts created on Windows that fail to run on Linux due to CRLF line endings
  • Preparing text data or log files on Linux for use in Windows-based applications
  • Cleaning up source code repositories to maintain consistent line endings across platforms
Alternatives:
  • tr – Standard Unix tool that can remove CR characters but lacks dos2unix's file handling and backup features.
  • sed – Stream editor that can perform replacements but requires more complex commands for safe conversion.
License: BSD-2-Clause
Bottles available for: arm64_tahoe, arm64_sequoia, arm64_sonoma, sonoma, arm64_linux, x86_64_linux
Version History
Detected Version Rev Change Commit
Oct 14, 2025 5:43pm 0 VERSION_BUMP bb0e7b10
Oct 14, 2025 4:31pm 0 VERSION_BUMP 78269de1
Sep 11, 2025 3:12am 0 VERSION_BUMP a9b9ca28