I have to convert an entire directory using dos2unix
. I am not able to figure out how to do this.
dos2unix is a tool to convert text files from DOS line endings (carriage return + line feed) to Unix line endings (line feed). It is also capable of conversion between UTF-16 to UTF-8. Invoking the unix2dos command can be used to convert from Unix to DOS.
Option 1: Converting DOS to UNIX with dos2unix Command The simplest way to convert line breaks in a text file is to use the dos2unix tool. The command converts the file without saving it in the original format. If you want to save the original file, add the -b attribute before the file name.
On Unix-like operating systems, the dos2unix and unix2dos commands convert plain text files from DOS or Mac format to Unix, and vice versa.
find . -type f -print0 | xargs -0 dos2unix
Will recursively find all files inside current directory and call for these files dos2unix command
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With