How can I run dos2unix on an entire directory?

Vivek Gaur picture Vivek Gaur · Aug 13, 2012 · Viewed 210.5k times · Source

I have to convert an entire directory using dos2unix. I am not able to figure out how to do this.

Answer

CyberDem0n picture CyberDem0n · Aug 13, 2012

find . -type f -print0 | xargs -0 dos2unix

Will recursively find all files inside current directory and call for these files dos2unix command