-
-
Save thaihust/b71f1174d09e844f943fabd81f5c7e71 to your computer and use it in GitHub Desktop.
Revisions
-
umidjons revised this gist
Jul 21, 2014 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,11 @@ Wouldn't break if you had spaces in file names. find . -type f -print0 | xargs -0 dos2unix ``` Convert only *.php files ```bash find . -type f -name "*.php" -print0 | xargs -0 dos2unix ``` If it's a large directory you may want to consider running with multiple processors: ```bash -
umidjons created this gist
Jul 18, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ Will recursively find all files inside current directory and call for these files dos2unix command. Would break if you had spaces in file name. ```bash find . -type f -exec dos2unix {} \; ``` Wouldn't break if you had spaces in file names. ```bash find . -type f -print0 | xargs -0 dos2unix ``` If it's a large directory you may want to consider running with multiple processors: ```bash find . -type f -print0 | xargs -0 -n 1 -P 4 dos2unix ``` This will pass 1 file at a time, and use 4 processors.