Skip to main content
deleted 16 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 239

Skipping binaries and hidden files were important for me:

This one worked well for me:

find . -type f -not -path '*/\.*' -exec grep -Il '.' {} \; | xargs -d '\n' -L 1 dos2unix -k 

Which translates to: find all non-hidden files recursively in the current directory, then using grep, list all non-binary (-I) non-empty files, then pipe it into xargs (delimited by newlines) one file at a time to dos2unix and keep the original timestamp.

See also:

https://github.com/mdolidon/endlines

Hope that helps.

Skipping binaries and hidden files were important for me:

This one worked well for me:

find . -type f -not -path '*/\.*' -exec grep -Il '.' {} \; | xargs -d '\n' -L 1 dos2unix -k 

Which translates to: find all non-hidden files recursively in the current directory, then using grep, list all non-binary (-I) non-empty files, then pipe it into xargs (delimited by newlines) one file at a time to dos2unix and keep the original timestamp.

See also:

https://github.com/mdolidon/endlines

Hope that helps.

Skipping binaries and hidden files were important for me:

This one worked well for me:

find . -type f -not -path '*/\.*' -exec grep -Il '.' {} \; | xargs -d '\n' -L 1 dos2unix -k 

Which translates to: find all non-hidden files recursively in the current directory, then using grep, list all non-binary (-I) non-empty files, then pipe it into xargs (delimited by newlines) one file at a time to dos2unix and keep the original timestamp.

See also:

https://github.com/mdolidon/endlines

added 32 characters in body
Source Link
phyatt
  • 617
  • 8
  • 11

Skipping binaries and hidden files were important for me:

This one worked well for me:

find . -type f -not -path '*/\.*' -exec grep -Il '.' {} \; | xargs -d '\n' -L 1 dos2unix -k 

Which translates to: find all non-hidden files recursively in the current directory, then using grep, list all non-binary (-I) non-empty files, then pipe it into xargs (delimited by newlines) one file at a time to dos2unix and keep the original timestamp.

See also:

https://github.com/mdolidon/endlines

Hope that helps.

Skipping binaries and hidden files were important for me:

This one worked well for me:

find . -type f -not -path '*/\.*' -exec grep -Il '.' {} \; | xargs -L 1 dos2unix -k 

Which translates to: find all non-hidden files recursively in the current directory, then using grep, list all non-binary (-I) non-empty files, then pipe it into xargs one file at a time to dos2unix and keep the original timestamp.

Hope that helps.

Skipping binaries and hidden files were important for me:

This one worked well for me:

find . -type f -not -path '*/\.*' -exec grep -Il '.' {} \; | xargs -d '\n' -L 1 dos2unix -k 

Which translates to: find all non-hidden files recursively in the current directory, then using grep, list all non-binary (-I) non-empty files, then pipe it into xargs (delimited by newlines) one file at a time to dos2unix and keep the original timestamp.

See also:

https://github.com/mdolidon/endlines

Hope that helps.

Source Link
phyatt
  • 617
  • 8
  • 11

Skipping binaries and hidden files were important for me:

This one worked well for me:

find . -type f -not -path '*/\.*' -exec grep -Il '.' {} \; | xargs -L 1 dos2unix -k 

Which translates to: find all non-hidden files recursively in the current directory, then using grep, list all non-binary (-I) non-empty files, then pipe it into xargs one file at a time to dos2unix and keep the original timestamp.

Hope that helps.