Convert all files to Unix Format from DOS/Windows
Guys, if you use Windows for coding and Linux or (*nix, Mac, SunOS, etc.,) then some times the files which you have saved in the Windows will not work in the *nix versions.
Also you might be using SVN for your repository and committing the files thru Windows machine.
Do you know why the files which have saved in the Windows doesn't works in the Linux flavored versions ? Okay, Okay, let me tell you its because Windows saves all the lines with a different ending character which Linux flavored versions doesn't understands it.
So here is the command to find all the files in a particular directory and its recursive too, excluding the SVN folders and change the files to unix format files.
find . -type f \! -path "*svn*" -exec dos2unix {} \;
Hope this would help you to do the functionality easily.
No comments:
Post a Comment