src: https://www.internalpointers.com/post/linux-find-and-replace-text-multiple-files
How to replace a string of text in multiple files inside a directory. Useful if you need to mass change a string in multiple files to something else to avoid editing each individually.
Enter the directory, for example we will use "/opt/configs" which would contain many files ending in a ".config" extension.
In this example we will want to change the text "{JAVA}" in all of the files ending with a .config extension inside /opt/configs directory to "/opt/java8/bin/java"...grep -RiIl '{JAVA}' *.config | xargs sed -i 's|{JAVA}|/opt/java8/bin/java|g'
If there is no output the strings have been replaced. If there is "no input files" output, that means there were no files that needed replacing.
Most Popular Articles
Setup Teamspeak 3 Server on Linux (CentOS)
If you run a gaming community, a Teamspeak 3 server is probably a popular choice for you to have...
Change MySQL Data Directory in Linux
There's many reasons that you might want to change the directory that your MySQL data is stored...
Disable root SSH access and setup sudo user on CentOS
Disabling root SSH logins and adding an additional sudo user is a good security measure for any...
Mojang Authentication Down (OpenJDK - Ubuntu/Debian)
If you're using Linux Ubuntu / Debian with Java OpenJDK (Spigot, Craftbukkit, Forge, etc.) and...
Force HTTPS / SSL for cPanel domain
Add the following to the top of the .htaccess file in your websites document root to force...