I have a .txt file from my Mac that when I send it over to my Raspberry Pi running Raspbian and open it in nano it converts weirdly. Example:

Text file in Mac OSX:


Text file in Raspbian:

Servers & Blades

Any help is appreciated.

  • It looks like your file has a mixture of different types of line endings. Please post the output of od -t x1 thefile.txt (the output should be the same on both machines). Do you care about which type of line ending is used, or do you just want an ordinary text file? – Gilles 'SO- stop being evil' May 26 '15 at 23:22
sed -i 's/\r/\n/g' thefile.txt

"classic" macos used \r as the end-of-line character. *nix uses \n

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.