Edlin
Template:Short description {{#invoke:other uses|otheruses}} {{#invoke:Infobox|infobox}}Template:Template other {{#invoke:Check for unknown parameters|check|unknown=Template:Main other|preview=Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y| AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo class | logo size | logo title | logo upright | logo_alt | logo_caption | logo_class | logo_size | logo_title | logo_upright | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | qid | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot class | screenshot size | screenshot title | screenshot upright | screenshot_alt | screenshot_class | screenshot_size | screenshot_upright | service_name | size | standard | title | ver layout | website }}Template:Main other{{#invoke:Check for conflicting parameters|check | template = Template:Infobox software | cat = Template:Main other | logo size; logo_size | logo class; logo_class | logo alt; logo_alt | logo title; logo_title | logo caption; logo_caption | screenshot size; screenshot_size | screenshot upright; screenshot_upright | screenshot class; screenshot_class | screenshot alt; screenshot_alt | screenshot title; screenshot title | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | programming language; programming_language | operating system; operating_system }}
Edlin is a line editor, and the only text editor provided with early versions of IBM PC DOS,[1] MS DOS and OS/2.[2] Although superseded in MS-DOS 5.0 and later by the full screen MS DOS Editor, and by Notepad in Microsoft Windows, it continued to be included in the 32 bit versions of Microsoft operating systems up to Windows Server 2008 and Windows 10. While Edlin itself was discontinued with the death of 32 bit Windows, Microsoft later revived the concept of a terminal focused editor in 2025 by releasing an open-source, modern command line editor called "Edit" for Windows 11.[3]
History
Edlin was created by Tim Paterson in two weeks in 1980, for Seattle Computer Products's 86-DOS (QDOS)[4] based on the CP/M context editor ED,[5][6] itself distantly inspired by the DEC PDP-10 TOPS-10 EDIT text editor.
Microsoft acquired 86-DOS and, after some further development, sold it as MS-DOS, so Edlin was included in v1.0–v6.22 of MS-DOS. From MS-DOS 6 onwards, the main editor included was the new full-screen MS-DOS Editor. On some distributions of 6.22, EDLIN was found on the supplementary tools disk instead of being installed by default.
Windows 95, 98 and ME ran on top of an embedded version of DOS, which reports itself as MS-DOS 7.
Edlin is included in the 32-bit versions of Windows NT[7] and its derivatives—up to and including Windows 10—because the NTVDM's DOS support in those operating systems is based on MS-DOS version 5.0. However, unlike most other external DOS commands, it has not been transformed into a native Win32 program. It also does not support long filenames, which were not added to MS-DOS and Windows until long after Edlin was written.
The FreeDOS version was developed by Gregory Pietsch.[8]
Usage
To start ediln from the DOS prompt, one would type the command Template:Kbd followed by the filename to be opened or created. Once the edilin prompt Template:Char appears. there are only a few commands for editing and a short listing of them can be seen by entering a Template:Char at the edlin prompt.
- L
- Lists (displays) lines of text. (e.g., Template:Kbd lists lines 1 through 6). Each line is displayed with a line number in front of it.
- Template:Sxhl
- The currently selected line has an Template:Char. To replace the contents of any line, the line number is entered and any text entered replaces the original. While editing a line pressing Template:Key cancels any changes. The Template:Char marker remains on that line.
- I
- Inserts one or more lines before the Template:Char line or the line number given. For example, Template:Kbd inserts a blank line before what was line 3 of the file, and Template:Kbd alone inserts at the currently selected line. To insert lines after the end of a document, use the Insert command and either specify a line number larger than the last line, or use the last line symbol Template:Char in Template:Kbd. When finished entering lines, Template:Key returns to the edlin command prompt.
- Template:Sxhl
- D
- Delete a specified line or a range of lines. e.g.: Template:Kbd deletes lines 2 through 4. In the above example, line 7 was deleted.
- R
- Replace all occurrences of a piece of text in a given range of lines, for example, to replace a spelling error. Including the ? prompts for each change. E.g.: To replace 'prit' with 'print' and to prompt for each change: Template:Kbd (the <syntaxhighlight lang="text" class="" style="" inline="1">^Z</syntaxhighlight> represents pressing Template:Key). It is case-sensitive.
- S
- Searches for given text. It is used in the same way as replace, but without the replacement text. A search for 'apple' in the first 20 lines of a file is typed Template:Kbd (no space, unless that is part of the search) followed by a press of enter. For each match, it asks if it is the correct one, and accepts n or y (or Enter).
- P
- Page displays starting from a specified line. If no line number is given, the line after the current line and the following 22 lines. The Page command changes the current line to the last line displayed, so one can page through a file by typing p for each screenful.
- T
- Transfers another file into the one being edited, with this syntax: [line to insert at]t[full path to file]. e.g. Template:Kbd will transfer a file on the b drive named addresses to just before line 5. The file content is taken from is not altered.
- W
- Write (save) the file.
- E
- Ends the editing session, saves the file and quits edlin.
- Q
- Quits edlin without saving.
- M
- Move a range of lines to before a specified line in the file. e.g. Template:Kbd moves lines 5 through 12 to just before line 26.[9]
- C
- Copy a range of lines to a specified line in the file one or more times. e.g. Template:Kbd Copies lines 18 through 24 to the Template:Char end of the document. Template:Kbd Copies lines 1 through 1 (just the first line) to just before line 25 and does so five times. Copy differs from Move in that the range you specify remains in its original location and is repeated in the new location.
Scripts
Edlin may be used as a non-interactive file editor in scripts by redirecting a series of edlin commands.
edlin < script
FreeDOS Edlin
A GPL-licensed clone of Edlin that includes long filename support is available for download as part of the FreeDOS project. This runs on operating systems such as Linux or Unix as well as MS-DOS.[10]
See also
- List of DOS commands
- ed and ex, similar Unix line editors.
- 86-DOS
References
Further reading
External links
- Edlin | Microsoft Docs
- MS-DOS edlin command help
- Open source EDLIN implementation that comes with MS-DOS v2.0
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ Template:Cite book
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ 16-Bit Applications Included with Windows NT, Microsoft.com
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ Template:Cite book
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}