Skip to content

Instantly share code, notes, and snippets.

@megatux
Created January 18, 2012 15:58
Show Gist options
  • Save megatux/1633716 to your computer and use it in GitHub Desktop.
Save megatux/1633716 to your computer and use it in GitHub Desktop.
Search and Replace a Word in all Files within Directory
# If you want to search and replace a word in all files within a specified directory in Unix, do the following:
# For example, here I wanted to do a global search and replace of all files within the current directory to ’2010′ from ’2008′.
find . -type f | xargs perl -pi -e 's/2008/2010/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment