---
type: link
tags: [link]
created: 2025-11-06T02:51:46.19+00:00
updated: 2026-04-06T10:58:44.18251+00:00
---# sed —  Replace text only on lines matching a pattern.

**URL:** [https://www.gnu.org/software/sed/manual/sed.html](https://www.gnu.org/software/sed/manual/sed.html)

sed | Replace text only on lines matching a pattern. sed '/pattern/s/old_text/new_text/g' file.txt


---
**Keywords:** link
