> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/all/bash/sed.md).

# Sed

Stream editor to do bash text manipulation

## String Substituting

First one hit

```bash
sed 's/hello/world/' input.txt > output.txt
```

Translate all

```bash
echo "hello hello my world world" | sed 's/hello/world/g'
```
