perl search replace on file

Snippet

Search and replace all instances of string in file on command line

perl -p -i -e 's/oldstring/newstring/g' *
 
perl -p -i -e 's/oldstring/newstring/g' `find ./ -name *.html`

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.