Skip to content

Instantly share code, notes, and snippets.

@krasnobaev
Last active August 29, 2015 14:23
Show Gist options
  • Save krasnobaev/16d89d2ad8c91bf0dfaa to your computer and use it in GitHub Desktop.
Save krasnobaev/16d89d2ad8c91bf0dfaa to your computer and use it in GitHub Desktop.
// convert tabs to 4 spaces
find . -type f -exec sed -i 's/[ \t]*$//' {} \;
// remove trailing spaces
find . -type f -exec sed -i 's/[ \t]*$//' {} \;
// add new line at the end of file
find . -type f -exec sed -i -e '$a\' {} \;
// convert CRLF to LF
find . -type f -exec sed -i 's/\r$//' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment