Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run dos2unix on an entire directory? [closed]

Tags:

linux

dos2unix

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

like image 774
Vivek Gaur Avatar asked Aug 13 '12 06:08

Vivek Gaur


People also ask

What does dos2unix mean in Linux?

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.

How do I run a dos2unix command in Unix?

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.

Is there a unix2dos command?

On Unix-like operating systems, the dos2unix and unix2dos commands convert plain text files from DOS or Mac format to Unix, and vice versa.


1 Answers

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

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

like image 63
CyberDem0n Avatar answered Oct 02 '22 01:10

CyberDem0n