Skip navigation

This is simply to remember how to change all the DOS “^M” line breaks, from files created in Windows when in need to edit them in a Unix environment.

  • Option 1)
    with Emacs, whith the file open, type:
    M-% C-q C-m RET RET !
  • Option 2)
    use the dos2unix command:
    dos2unix somefile.txt
  • Option 3)
    to apply option 2 inside an emacs buffer:
    C-x h (to select-all)
    C-u M-x shell-command-on-region
    dos2unix RET

One Comment

  1. C-x RET f utf-8-unix RET C-x C-s

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: