Convert all EOL (dos->unix) of all files in a directory and sub-directories recursively without dos2unix

bash, command-line, end-of-line, linux, unix

Solution

For all files in current directory you can do it with a Perl one-liner: `perl -pi -e 's/\r\n/\n/g' *` (stolen from here)

EDIT: And with a small modification you can do subdirectory recursion:

find | xargs perl -pi -e 's/\r\n/\n/g'

Problem

How do I convert all EOL (dos->unix) of all files in a directory and sub-directories recursively without `dos2unix`? (I do not have it and cannot install it.) Is there a way to do it using `tr -d '\r'` and pipes? If so, how?

Original source