Recusrive dos2unix exclude images

I've recently been caught out by my web server complaining of an internal server error 500, and discovered that is was due to the Windows CR/LF file format being used against the required Linux LF file format.

This was totally my fault as I had the wrong setting on Dreamweaver.

I've now managed to get my site running again by manually using the dos2unix utility, but don't want to have to do this to over 16,000 files.

I now need to ensure the rest of the files are in the required LF format, and am looking for a recursive method to apply the dos2unix command.

However, I've carried out a manual trial run on specific files within a directory and noticed that images, particularly .png, become corrupt.

My site has a lot of images, so I'm now looking for a method to apply the dos2unix command recursively from the root of the web site to all its sub directories, but excluding all images.

I've googled a few sites and have found:

find . -type f -exec dos2unix {} \;

find . -type f -print -exec dos2unix \{\} \;

However, I'm still a relative newbie on Linux, and don't have the confidence or understanding to apply the above. Also, it seems apparent that these above example statements have no exclusion for images.

I therefore need someone to help me with the above by either sending me the correct command line statement, or an alternative method.

btw - since it's Easter, I may not be able to get back to this until next week, if I don't get a fast response

Taidot: Linux, PHP

Näytä lisää: dos2unix recursive, recursive dos2unix, dos2unix excluding images, dos2unix recursive exclude, dos2unix exclude, dos2unix images, dos2unix exclude images, recusrive dos2unix, web dos, recursively, linux find recursive, get found, find unix, dos web site, dos line, dos find, linux dos2unix recursive, recursive dos2unix windows, find type dos2unix, dos2unix exclude files, dos2unix command recursive, dos2unix recursive windows, dos2unix dreamweaver, dos2unix recursive html, dos2unix recursive find

About the Employer:
( 47 reviews ) London, United Kingdom

Projektin tunnus: #416411