What it does
dos2unix bundles utilities that convert DOS, Mac and Unix line endings, with in-place, paired-output and standard-stream modes.
Inspect a file's line-ending and BOM information before choosing the required conversion. The default old-file mode replaces the input after successful processing through a temporary file. Use paired new-file mode with a separate input and output name to keep a converted copy; do not use wildcards in that paired mode. Binary, nonregular and symbolic-link files are skipped by default, but binary detection is imperfect. UTF-16 handling depends on the build and platform; Keep UTF-16 preserves that encoding instead of converting it. Keeping original dates is an optional setting.
Strengths
- Several line-ending conversion directions
- Paired-output and standard-stream modes
Best for
- Preparing text files for a different operating system
Sources
- dos2unix / unix2dos - Text file format converters (Oct 26, 2026)
- dos2unix current release and FreeBSD source licence (Oct 26, 2026)
- dos2unix info, paired output and default mutation (Oct 26, 2026)