Linux Command: Replace a String in Multiple Files

If you want to replace a string in multiple files in a folder, you can use the following command:

cd /path/to/folder
sed -i 's/foo/bar/g' *

In the command line above, all occurrences of "foo" will be replaced with "bar".

Category >> Linux  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
<pre><code> 
String foo = "bar";
</code></pre>