DEV Community

Discussion on: Living in the Shell #14; sed (Text Stream Editor) (Part 1)

Collapse
 
cubikca profile image
Brian Richardson

These were some uses of sed I wasn't aware of, thanks. Still, the true power of sed must be acknowledged to be its replacement capabilities using regular expressions. For example, search and replace within a directory:

find . -name \*.js -exec cat {} | sed -e 's#replaceme#replacement#g' > output.txt

Collapse
 
babakks profile image
Babak K. Shandiz

That's right. I'll cover some use cases of string/pattern substitution in Part 2.