Thursday, September 25, 2008

Using find to do operations on multiple files

I learned this technique from my sifoo when he had to change a bunch of html files to unix using dos2unix command. I found that this is very useful and I would like to share it :)

To find files with the extension .html in the current folder and run command dos2unix to all of them:
  • $ find . -type f -name *html -exec dos2unix ’{}’ \;
To see more use of find, refer to find manpage:
  • $ man find

No comments:

Post a Comment