Help for this page

Select Code to Download


  1. or download this
      find . -type f \! -name '*.bak' -print0 | \
        xargs -0 perl -i.bak -plwe 's/foo/bar/g'
    
  2. or download this
      find . -type f -name '*.html' -print0 | \
        xargs -0 perl -i.bak -plwe 's/foo/bar/g'
    
  3. or download this
      perl -i.bak -plwe 's/foo/bar/g' file1.txt file2.txt file3.txt
    
  4. or download this
      for i in file1.txt file2.txt file3.txt
      do
          mv $i $i.bak
          perl -plwe 's/foo/bar/g' < $i.bak > $i
      done