# phpman > man > ED(1)

> **TLDR:** The original Unix text editor.
>
- Start an interactive editor session with an empty document:
  `ed`
- Start an interactive editor session with an empty document and a specific prompt:
  `ed {{-p|--prompt}} '{{> }}'`
- Start an interactive editor session with user-friendly errors:
  `ed {{-v|--verbose}}`
- Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt:
  `ed {{-q|--quiet}} {{-s|--script}}`
- Start an interactive editor session without exit status change when command fails:
  `ed {{-l|--loose-exit-status}}`
- Edit a specific file (this shows the byte count of the loaded file):
  `ed {{path/to/file}}`
- [Interactive] Replace a string with a specific replacement for all lines:
  `,s/{{regex}}/{{replacement}}/g`
- [Interactive] Exit `ed`:
  `q`

*Source: tldr-pages*

---

[ED(1)](https://www.chedong.com/phpMan.php/man/ED/1/markdown)                                       User Commands                                      [ED(1)](https://www.chedong.com/phpMan.php/man/ED/1/markdown)



## NAME
       ed - line-oriented text editor

## SYNOPSIS
       **ed** [_options_] [_file_]

## DESCRIPTION
       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 such as
       GNU Emacs or GNU Moe.

## 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
              use STRING as an interactive prompt

### -r --restricted
              run in restricted mode

### -s --quiet --silent
              suppress diagnostics, byte counts and '!' prompt

### -v --verbose
              be verbose; equivalent to the 'H' command

### --strip-trailing-cr
              strip carriage returns at end of text lines

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

       Exit  status:  0  for  a  normal  exit, 1 for environmental problems (file not found, invalid
       flags, I/O errors, etc), 2 to indicate a corrupt or invalid input file,  3  for  an  internal
       consistency error (e.g., bug) which caused ed to panic.

## REPORTING BUGS
       Report bugs to <bug-ed@gnu.org>
       Ed home page: <http://www.gnu.org/software/ed/ed.html>
       General help using GNU software: <http://www.gnu.org/gethelp>

## COPYRIGHT
       Copyright © 1994 Andrew L. Moore.
       Copyright   ©  2022  Antonio  Diaz  Diaz.   License  GPLv2+:  GNU  GPL  version  2  or  later
       <<http://gnu.org/licenses/gpl.html>>
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to
       the extent permitted by law.

## SEE ALSO
       The full documentation for **ed** is maintained as a Texinfo manual.  If the **info** and **ed** programs
       are properly installed at your site, the command

              **info** **ed**

       should give you access to the complete manual.



GNU ed 1.18                                 February 2022                                      [ED(1)](https://www.chedong.com/phpMan.php/man/ED/1/markdown)
