Skip to content

Windows EDLIN command

The Windows EDLIN command is a simple text editor used to create and edit text files directly from the command line interface. This command allows users to quickly make changes to files without the need for a graphical interface. With EDLIN, users can insert, delete, and modify text within a file using a series of commands. While not as user-friendly as modern text editors, EDLIN provides a lightweight and efficient way to work with text files in a command-line environment.

EDLIN Syntax:

Terminal window
edlin [Drive:][Path] FileName

Options:

OptionDescription
/cClears the screen before editing the file
/qSuppresses the display of filenames while editing multiple files
/pEnables color highlighting of various parts of the screen
/sOverrides the default display of filenames for multiple file editing

Parameters:

ParameterDescription
[Drive:]Specifies the drive letter
[Path]Specifies the path to the file
FileNameSpecifies the name of the file to open

EDLIN Usage:

Create a New Text File

Terminal window
edlin newfile.txt

Opens the edlin text editor to create and edit a new text file named “newfile.txt”.

Insert Text Into a File

Terminal window
edlin existingfile.txt

Opens an existing file named “existingfile.txt” in the edlin text editor to insert or modify text.

Save Changes and Exit

Terminal window
edlin -s existingfile.txt

Saves changes made to the file named “existingfile.txt” using edlin and exits the text editor.

Display Line Numbers

Terminal window
edlin -n existingfile.txt

Opens the file named “existingfile.txt” in the edlin text editor and displays line numbers for each line of text.

Common Questions on EDLIN Usage:

How do I use edlin in Windows?

To use the edlin command in Windows, execute the following command:

Terminal window
edlin file.txt

What is the purpose of edlin in Windows CMD?

The edlin command in Windows CMD is used as a line-oriented text editor to create or modify text files directly from the command line.

How do I display a specific line in a text file using edlin?

You can display a specific line in a text file using edlin by specifying the line number when opening the file. For example:

Terminal window
edlin file.txt:5

Can I copy content from one file to another using edlin in Windows?

Yes, you can copy content from one file to another using edlin by utilizing the insert command along with the read command. Here is an example:

Terminal window
edlin file1.txt
r file2.txt
w newfile.txt

How can I save changes and exit edlin in Windows CMD?

To save changes and exit edlin in Windows CMD, use the write and quit commands. Here’s how you can do it:

Terminal window
edlin file.txt
w
q

Is it possible to delete a specific line from a text file using edlin?

Yes, you can delete a specific line from a text file using edlin by referencing the line number along with the delete command. For instance:

Terminal window
edlin file.txt
d5

Can I navigate between lines efficiently while using edlin in Windows?

You can navigate between lines efficiently while using edlin in Windows by utilizing commands like next, previous, and go-to. Here is an example:

Terminal window
edlin file.txt
n
p
g10

Applications of the EDLIN Command

  1. Creating or editing text files
  2. Manipulating text within files
  3. Viewing contents of text files
  4. Searching for specific text within files
  5. Copying and moving text within files