[LINUX] How to remove end-of-line code (CR) [^ M]

Carriage Returns \r ^M How to remove

Only one file

sed -i 's/\r$//g' <filename> 

All files under the current directory

sed -i 's/\r$//g' $(find . -type f)

reference

https://stackoverflow.com/questions/800030/remove-carriage-return-in-unix

Corrected the pointed out part.

Recommended Posts

How to remove end-of-line code (CR) [^ M]
How to run TensorFlow 1.0 code in 2.0
Qiita (1) How to write a code name
How to code a drone using image recognition
Learn how to inflate images from TensorFlow code
How to remove duplicate elements in Python3 list
[Python] How to remove duplicate values from the list
How to make a Python package using VS Code
How to create a kubernetes pod from python code
How to use xml.etree.ElementTree
How to use virtualenv
Scraping 2 How to scrape
How to use Seaboan
How to use image-match
How to use shogun
How to install Python
How to use Pandas 2
How to read PyPI
How to install pip
How to use Virtualenv
How to use numpy.vectorize
How to update easy_install
How to install archlinux
How to use pytest_report_header
Rewrite Python2 code to Python3 (2to3)
How to restart gunicorn
How to install python
How to virtual host
How to debug selenium
How to use partial
How to use Bio.Phylo
How to read JSON
How to use SymPy
How to use x-means
How to use WikiExtractor.py
How to update Spyder
How to use IPython
How to install BayesOpt
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use TokyoTechFes2015
How to use venv
How to use dictionary {}
How to use Pyenv
How to grow dotfiles
How to use list []
How to use python-kabusapi
"How to count Fukashigi"
How to install Nbextensions
How to use OptParse
How to use return
How to install Prover9
How to use dotenv
How to operate NumPy
How to use pyenv-virtualenv
How to use Go.mod
How to use imutils
How to use import
How to use VS Code in venv environment on windows