I'm wondering if there is a way to change a specific word in all of the files within the /www/ directory using command line. Just looking for a faster way to change out a specific word so I don't need to open all the files manually! Thanks!
Asked
Active
Viewed 96 times
0
-
What is "terminal"? And what does this have to do with programming? – John Saunders Jul 11 '10 at 05:02
-
Terminal is os x command line. Sorry, I should have been more clear. – user1875332 Jul 11 '10 at 05:07
2 Answers
0
You might be looking for a grep-sed solution to find and replace, if you are on a Mac (and referring to the Mac's Terminal app).

Community
- 1
- 1

Jeff Meatball Yang
- 37,839
- 27
- 91
- 125
0
find /www -type f -exec sed -i 's/foo/bar/g' \{\} \;
This line will replace foo with bar every time foo occurs in any file in /www
. Be very sure you know what's under /www
and what the replacement would do to those files before running it.

Borealid
- 95,191
- 9
- 106
- 122