sed Replace foo with bar in a file :) Bash sed -i 's/foo/bar/g' /some/path/file.txt Replace "dark" or "somecrap" or "light" to "boles" Bash sed -i 's/dark/boles/g;s/somecrap/boles/g;s/light/boles/g' /some/path/file.txt Delete line using matching patterns in a line Bashsed -i '/pattern-to-match/d' ./some/file Mach based on part of a pattern Bashsed -i '/backend=/c\ export backend=soemthing' somefile