Friday, April 25, 2008

dos2unix On Every File in a Dir

I am by no means a Linux expert and I find myself forgetting obvious commands if I haven't used them for a while.

Today, I found myself needing to apply the app 'dos2unix' on a bunch of files recursively in a directory.

After fumbling for a few minutes, this is what I came up with:

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

Now hopefully, I wont forget again!