sed [options] script [file...]Arguments explained
- script describes the edit, such as s/old/new/.
- -n suppresses automatic printing.
- -i edits files in place on many sed versions.
Common examples
sed 's/error/ERROR/g' app.logPrints app.log with replacements, without changing the file.
sed -n '10,20p' file.txtPrints lines 10 through 20.
| Field | Details |
|---|---|
| Command | sed |
| Category | Text Processing |
| Primary use | Edits text streams with scripted rules. |
| Syntax | sed [options] script [file...] |