# Find and Replace in a Stream: sed

sed changes text as it flows past, replacing words with s/old/new/g and deleting lines with d, and sed -i.bak changes the files themselves while keeping a backup of each one.

![Cheat sheet for the lesson Find and Replace in a Stream: sed: sed changes text as it flows past, replacing words with s/old/new/g and deleting lines with d, and sed -i.bak changes the files themselves while keeping a backup of each one.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/e02b95539b074a44a506962ce55a6e8c.webp)

- Category: Bash
- Level: Journeyman
- Tags: in-place-editing, linux, regular-expression-in-the-shell, sed, unix
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-sed-cheat-sheet
