How to change the line endings in Linux
Check line endings
Using file command
file abc.txt
Result:
- Unix:
abc.txt: ASCII text
- DOS:
abc.txt: ASCII text, with CRLF line terminators
Change line endings
Using dos2unix command
dos2unix abc.txt
Using unix2dos command
unix2dos abc.txt
Enjoy Reading This Article?
Here are some more articles you might like to read next: