Skip to content

Instantly share code, notes, and snippets.

@deviousway
Last active March 29, 2018 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deviousway/810e2ba5515848fca67d3817658f124f to your computer and use it in GitHub Desktop.
Save deviousway/810e2ba5515848fca67d3817658f124f to your computer and use it in GitHub Desktop.
Sed replace line what contain
sed -i 's/domain1\.com/domain2\.com/d'
sed -i '/<?php/c\<?php'
#Add line (/n) after line what contain pattern
grep -rl 'pattern' public_html/ |xargs sed -i "s/1; ?>/1; ?>\n/g"
#remove line what contain
grep -rl 'pattern' public_html/ |xargs sed -i '/pattern/d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment