1

Is it feasible to fix line endings in all non-binary files under a directory?
There are a lot of answers how to fix line endings in a file.
I'm wondering if it is possible for the command to analyze all files and fix only those which needed.

Mike
  • 20,010
  • 25
  • 97
  • 140
  • find ./ -type f -exec dos2unix {} \; [source](http://stackoverflow.com/questions/7068179/convert-line-endlings-for-whole-directory-tree-git) – Mike Jun 11 '15 at 15:07

1 Answers1

0

find ./ -type f -exec dos2unix {} \; source – Mykhaylo Adamovych

Community
  • 1
  • 1
Armali
  • 18,255
  • 14
  • 57
  • 171
  • 1
    Note that there are different implementations of dos2unix. Not all of them automatically skip binary files. First check if your dos2unix version skips binary files. – Erwin Waterlander Nov 06 '15 at 16:58