Skip to content

Instantly share code, notes, and snippets.

@iandundas
Created May 20, 2013 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iandundas/5610472 to your computer and use it in GitHub Desktop.
Save iandundas/5610472 to your computer and use it in GitHub Desktop.
Convert files to Unix line endings
find * -name "*.js" -print0 | xargs -0 /usr/bin/dos2unix
find * -name "*.css" -print0 | xargs -0 /usr/bin/dos2unix
find * -name "*.htm" -print0 | xargs -0 /usr/bin/dos2unix
find * -name "*.html" -print0 | xargs -0 /usr/bin/dos2unix
find * -name "*.php" -print0 | xargs -0 /usr/bin/dos2unix
#etc
#where /usr/bin/dos2unix is:
#!/bin/sh
perl -pi -e 's/\r\n/\n/;' $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment