2020-05-06 21:40:22 +02:00
|
|
|
# dos2unix
|
|
|
|
|
2020-05-10 15:12:37 +02:00
|
|
|
> Change DOS-style line endings to Unix-style.
|
2022-06-30 21:58:39 +02:00
|
|
|
> Replaces CRLF with LF.
|
2024-08-30 18:20:23 +10:00
|
|
|
> See also `unix2dos`, `unix2mac`, and `mac2unix`.
|
2021-07-09 16:45:55 +02:00
|
|
|
> More information: <https://manned.org/dos2unix>.
|
2020-05-06 21:40:22 +02:00
|
|
|
|
2020-05-10 21:22:17 +02:00
|
|
|
- Change the line endings of a file:
|
2020-05-06 21:40:22 +02:00
|
|
|
|
2024-08-30 18:20:23 +10:00
|
|
|
`dos2unix {{path/to/file}}`
|
2020-05-06 21:40:22 +02:00
|
|
|
|
2020-05-10 15:12:37 +02:00
|
|
|
- Create a copy with Unix-style line endings:
|
2020-05-06 21:40:22 +02:00
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`dos2unix {{[-n|--newfile]}} {{path/to/file}} {{path/to/new_file}}`
|
2024-08-30 18:20:23 +10:00
|
|
|
|
|
|
|
- Display file information:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`dos2unix {{[-i|--info]}} {{path/to/file}}`
|
2024-08-30 18:20:23 +10:00
|
|
|
|
|
|
|
- Keep/add/remove Byte Order Mark:
|
|
|
|
|
|
|
|
`dos2unix --{{keep-bom|add-bom|remove-bom}} {{path/to/file}}`
|