ed
standard Unix line editor
TLDR
SYNOPSIS
ed [options] [file]
DESCRIPTION
ed is the standard Unix line editor. It operates in command mode by default, accepting single-letter commands to navigate, view, and modify text. It's the ancestor of sed and vi.Commands typically consist of an address or range followed by a command letter. Addresses can be line numbers, patterns, or special characters (. for current, $ for last line).ed is useful for scripted editing, as commands can be piped to it. Its minimal interface makes it valuable for emergency system recovery when full-screen editors aren't available.
PARAMETERS
FILE
File to edit.-p STRING, --prompt=STRING
Use STRING as the command prompt (there is no prompt by default).-s, --quiet, --script
Suppress diagnostics, byte counts and the '!' prompt: the usual choice for scripts.-E, --extended-regexp
Use extended regular expressions instead of basic ones.-G, --traditional
Run in compatibility mode with the traditional Unix ed.-l, --loose-exit-status
Exit with 0 status even if a command fails.-r, --restricted
Restricted mode: disallow shell escapes and editing files outside the current directory.-v, --verbose
Print full error messages rather than a bare '?'.--help
Display help and exit.--version
Display version and exit.
CAVEATS
No visual feedback by default. Errors reported with "?" unless verbose. Learning curve for command syntax. Not suitable for casual editing.
HISTORY
ed was written by Ken Thompson at Bell Labs in 1969, making it one of the earliest Unix programs. Its design influenced sed, ex, vi, and ultimately modern text editors.
