From LedHed's Wiki
Revision as of 16:31, 8 July 2010 by Ledhed (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Inline Find and Replace

To do an inline find and replace using sed use the following syntax

sed -i 's/<FIND_TEXT>/<REPLACE_TEXT>/g' /path/to/file.txt

-i = Inline
s/ = Search
/g = Global


Reference

http://www.brunolinux.com/02-The_Terminal/Find_and%20Replace_with_Sed.html