Skip to content
Adam Dobbs edited this page Nov 27, 2013 · 4 revisions

Stream Editor. Fast and simple using standard GNU Regular Expression Syntax.

A nice fact is that Vim uses very similar syntax for searching and replacing.

Tips

  • Basic usage example:
echo hello world | sed 's/hello/good morning/' 

Output:

good morning world
  • Replace text in multiple files via grep:
grep -rl "string_to_match_in_files" somedirectory/ | xargs sed -i 's|string1|string2|g'

This can be further refined by piping from find aswell.

Links

Clone this wiki locally