Developer's Lab

By Diogo Pinto - DiØ

Replace With Stream Editor(AKA Sed)

The sed is command-line utility editor, which filtering and transforming text. Below an example of how it works replacement order:

1
sed -i 's/input/replacement/g' some_file

where:

  • i = –in-place, edit file.txt and save it.
  • s = substitute statement.
  • input = original match case.
  • replacement = matched replacement it with.
  • g = global(replace all occurrence, instead of first occurrence).
  • some_file = some target file.
  • Comments