#Standalone command
sed -i 's/old string/new string/g' /home/dude/text-file.txt
## use a custom separator
sed -i 's:old/folder/path:new/folder/path:g' /home/dude/text-file.txt
## dry run
sed 's/old string/new string/g' | less
# Combined with find command to search and replace strings inside multiple files
sudo find /var/www/example.com/public_html -type f -exec sed -i 's/old string/new string/g' {} \;
sudo find /var/www/example.com/public_html -type f -exec sed -i 's:old/folder/path:new/folder/path:g' {} \;
sudo find /etc/td-agent/config.d/ -type f -exec sed -i 's:192.168.0.1:192.168.0.2:g' {} \;