This are my notes in the fields of computer science and technology. Everything is written with ABSOLUTE NO WARRANTY of fitness for any purpose. Of course, feel free to comment anything.

Thursday, July 23, 2009

Conversion of CR+LF to LF

The following will convert all files also in subdirectories
exept for those starting with a dot (skips also such directories).
This works if dos2unix is available, of course; otherwise use sed.

find ^.* -exec dos2unix '{}' \;

I needed it to convert the content of a git repository (that's
why I skipped the . files: I didn't want .git/* files to be included).
Of course you can write better matching chriteria, but this worked
fine for my case.

About Me

My photo
Hamburg, Hamburg, Germany
Former molecular biologist and web developer (Rails) and currently research scientist in bioinformatics.