Skip to content

Instantly share code, notes, and snippets.

@razhangwei
Created April 12, 2019 00:07
Show Gist options
  • Save razhangwei/79c90bc7d606d3a2c0c05bbfe1d00542 to your computer and use it in GitHub Desktop.
Save razhangwei/79c90bc7d606d3a2c0c05bbfe1d00542 to your computer and use it in GitHub Desktop.
Search and remove ^M in all files in a directory #Unix
find . -type f | xargs -Ix sed -i.bak -r 's/\r//g' x
find . -type f -name '*.bak' | xargs -Ix rm x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment