1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-01 23:55:26 +02:00
tldr/pages/common/ed.md

38 lines
915 B
Markdown
Raw Normal View History

# ed
> The original Unix text editor.
> See also: `awk`, `sed`.
> More information: <https://www.gnu.org/software/ed/manual/ed_manual.html>.
- Start an interactive editor session with an empty document:
`ed`
- Start an interactive editor session with an empty document and a specific prompt:
2025-03-12 21:05:58 +02:00
`ed {{[-p|--prompt]}} '{{> }}'`
- Start an interactive editor session with user-friendly errors:
2025-03-12 21:05:58 +02:00
`ed {{[-v|--verbose]}}`
- Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt:
2025-03-12 21:05:58 +02:00
`ed {{[-q|--quiet]}}`
- Start an interactive editor session without exit status change when command fails:
2025-03-12 21:05:58 +02:00
`ed {{[-l|--loose-exit-status]}}`
- Edit a specific file (this shows the byte count of the loaded file):
`ed {{path/to/file}}`
- Replace a string with a specific replacement for all lines:
2025-03-12 21:05:58 +02:00
`,s/{{regular_expression}}/{{replacement}}/g<Enter>`
- Exit ed:
`q<Enter>`