Search This Blog

Tuesday, October 25, 2016

replace with sed in directory and sub directories


  1. # goto the folder
  2. cd ~/pentaho/repository/
  3. # verify how many strings exist.
  4. grep -R 192.168.1.11 .
  5. # replace
  6. find ./ -type f -exec sed -i -e 's/192.168.1.11/192.168.2.20/g' {} \;
  7. # double check the result.
  8. grep -R 192.168.2.20|wc -l

No comments:

Post a Comment