ArticleslgStudy

computer science

Edlin

Edlin is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Edlin rather than just read about it. In short: Edlin is a line editor, and the only text editor provided with early versions of IBM PC DOS, MS DOS and OS/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.

Edlin — main illustration
Edlin — illustration

Key takeaways

  • Edlin belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Edlin to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Edlin from memory before moving on to harder problems.

Reference excerpt

Edlin is a line editor, and the only text editor provided with early versions of IBM PC DOS, MS DOS and OS/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.

History

Edlin was created by Tim Paterson in two weeks in 1980, for Seattle Computer Products's 86-DOS (QDOS) based on the CP/M context editor ED, 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 5 onward, 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 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.

Usage To start ediln from the DOS prompt, one would type the command edlin followed by the filename to be opened or created. Once the edilin prompt * appears. there are only a few commands for editing and a short listing of them can be seen by entering a ? at the edlin prompt.

L Lists (displays) lines of text. (e.g., 1,6L lists lines 1 through 6). Each line is displayed with a line number in front of it.

The currently selected line has an *. To replace the contents of any line, the line number is entered and any text entered replaces the original. While editing a line pressing Ctrl+C cancels any changes. The * marker remains on that line. I Inserts one or more lines before the * line or the line number given. For example, 3i inserts a blank line before what was line 3 of the file, and i 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 # in #i. When finished entering lines, Ctrl+C returns to the edlin command prompt.

D Delete a specified line or a range of lines. e.g.: 2,4d 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: ?rprit^Zprint (the ^Z represents pressing CTRL+Z). 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 1,20?sapple (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. 5tb:addresses 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. 5,12,26m moves lines 5 through 12 to just before line 26. C Copy a range of lines to a specified line in the file one or more times. e.g. 18,24,#c Copies lines 18 through 24 to the # end of the document. 1,1,25,5c 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.

See also List of DOS commands ed and ex, similar Unix line editors. 86-DOS

References

Further reading Microsoft Operating System/2 User's Reference (PDF). Microsoft. 1987.

External links

Edlin | Microsoft Docs MS-DOS edlin command help Open source EDLIN implementation that comes with MS-DOS v2.0

Illustrations

Edlin illustration
Edlin: Using EDLIN for typing Japanese with the ATOK 8 input method editor, running on MS-DOS 3.3C for the PC-9800 series
Using EDLIN for typing Japanese with the ATOK 8 input method editor, running on MS-DOS 3.3C for the PC-9800 series

Worked examples

Example 1 — a first encounter with Edlin

Start with the simplest possible case. Write down what Edlin claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Edlin before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Edlin ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Edlin

In research
Edlin appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Edlin in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Edlin is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1980 software, DOS text editors, Line editor, so understanding it makes those chapters shorter.
In everyday life
Look for Edlin outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Edlin” →

How to study Edlin in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Edlin means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Edlin out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Edlin in simple terms?

Edlin is a line editor, and the only text editor provided with early versions of IBM PC DOS, MS DOS and OS/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…

Why does Edlin matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Edlin?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Edlin.

Tags

  • 1980 software
  • DOS text editors
  • Line editor
  • Microsoft free software
  • OS/2 commands
  • Windows commands
  • Windows components
  • Windows text editors

Keep exploring