Skip to content

Instantly share code, notes, and snippets.

@kelvinn
Created June 6, 2014 13:01
Show Gist options
  • Save kelvinn/512f72bf1015047af945 to your computer and use it in GitHub Desktop.
Save kelvinn/512f72bf1015047af945 to your computer and use it in GitHub Desktop.
Recursively Change Line Endings (Windows)
REM On Unix you would do this: find ./ -type f -exec dos2unix {} \;
REM After installing dos2unix.exe in Windows, you can create a small bat script with the below in it to
REM recursively change the line endings. Careful if you have any hidden directories (e.g. .git)
for /f "tokens=* delims=" %%a in ('dir "C:\Users\username\path\to\directory" /s /b') do (
"C:\Program Files\unix2dos.exe" %%a
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment