red(1)

red1

Line-oriented text editor

Part of ed(1).

Usage

ed [options] [[+line] file]

Overview

GNU ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files, both interactively and via shell scripts. A restricted version of ed, red, can only edit files in the current directory and cannot execute shell commands. Ed is the 'standard' text editor in the sense that it is the original editor for Unix, and thus widely available. For most purposes, however, it is superseded by full-screen editors.

The file name may be preceded by '+line', '+/RE', or '+?RE' to set the current line to the line number specified or to the first or last line matching the regular expression 'RE'.

Start edit by reading in 'file' if given. If 'file' begins with a '!', read output of shell command.

The environment variable LINES can be used to set the initial window size.

Options

-h, --help

display this help and exit

-V, --version

output version information and exit

-E, --extended-regexp

use extended regular expressions

-G, --traditional

run in compatibility mode

-l, --loose-exit-status

exit with 0 status even if a command fails

-p, --prompt=STRING

use STRING as an interactive prompt

-q, --quiet, --silent

suppress diagnostics written to stderr

-r, --restricted

run in restricted mode

-s, --script

suppress byte counts and '!' prompt

-v, --verbose

be verbose; equivalent to the 'H' command

--strip-trailing-cr

strip carriage returns at end of text lines

--unsafe-names

allow control characters in file names

Exit status

0 for a normal exit, 1 for environmental problems (invalid command-line options, memory exhausted, command failed, etc), 2 for problems with the input file (file not found, buffer modified, I/O errors), 3 for an internal consistency error (e.g., bug) which caused ed to panic.

Releases

17 releases since Debian 1.3 (Bo); the text changed 11 times.

  1. 1.3–2.2
  2. 3.0
  3. 3.1–4.0
  4. 5.0
  5. 6.0
  6. 7
  7. 8–9
  8. 10
  9. 11
  10. 12
  11. 13
  12. Arch

--extended-regexp since Debian 11 (Bullseye); --help since Debian 7 (Wheezy); --loose-exit-status since Debian 7 (Wheezy); --prompt since Debian 7 (Wheezy); --quiet since Debian 7 (Wheezy); --restricted since Debian 7 (Wheezy); --script since Debian 12 (Bookworm); --silent since Debian 7 (Wheezy); --strip-trailing-cr since Debian 12 (Bookworm); --traditional since Debian 7 (Wheezy); --unsafe-names since Debian 13 (Trixie); --verbose since Debian 7 (Wheezy); --version since Debian 7 (Wheezy); -E since Debian 11 (Bullseye); -V since Debian 7 (Wheezy); -h since Debian 7 (Wheezy); -l since Debian 7 (Wheezy); -q since Debian 12 (Bookworm); -r since Debian 7 (Wheezy); -v since Debian 7 (Wheezy).

Reporting bugs

Report bugs to [email protected]
Ed home page: http://www.gnu.org/software/ed/ed.html
General help using GNU software: http://www.gnu.org/gethelp

From ed 1.22.6-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.