LoginSignup
12
10

More than 5 years have passed since last update.

改行コードをCR+LF(Windows)からLF(Linux)に変更する方法

Posted at
  • Windowsの改行コードはCR+LF
  • Linuxの改行コードはLF
  • メールとかで添付されたファイルをMacのemacsで開くと"^M"が表示されてうざい(時がある)
  • コマンドラインですっきり解決
$ tr -d '\r' < original_file > edited_file
  • 上のコマンドだと改行が無くなっちゃうときがある
  • そんな時はこれ
$ tr '\r' '\n' < original_file > edited_file
  • そもそもメールでコードのやり取りとかはうざい
  • gitとか使ったほうがいい
12
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
10