Created
January 18, 2012 15:58
-
-
Save megatux/1633716 to your computer and use it in GitHub Desktop.
Search and Replace a Word in all Files within Directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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