Convert line endings [duplicate]
This question already has an answer here: How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script? 23 answers I have been using d2u to convert line endings. After installing Puppy Linux I noticed that it does not come with d2u , but dos2unix . Then I noticed that Ubuntu is missing both by default. What is another way to convert line endings? jaypal singh Some options: Using tr tr -d '\15\32' < windows.txt > unix.txt OR tr -d '\r' < windows.txt > unix.txt Using perl perl -p -e 's/\r$//' < windows.txt > unix.txt Using sed sed 's/^M$//' windows.txt > unix.txt OR sed 's/\r$