Convert Windows line endings
medium risk
Converts CRLF to LF (and unix2dos does the reverse). Fixes “bad interpreter: ^M” errors in scripts.
| Flag | Meaning |
|---|---|
-n | Write to a new file |
-k | Keep timestamps |
dos2unix script.shFix a script in place · explain & risk-check →dos2unix -n in.txt out.txtConvert to a new file · explain & risk-check →Reference text is hand-written and may be incomplete — check man dos2unix for your version. Test destructive commands on a non-production system first.