Pardon the dust!
This page includes some jargon that hasn't been added to the site's glossary yet. I'll be around to fix this later, but sorry for the inconvenience in the meantime.

DOS Basics

Overview

Back in the 1980s, MS-DOS ruled the home computer market. Compared to today's operating systems, it was barely more than a glorified command line, but we made it work. Today, people generally only use it (or something mimicking it) when they want to use very old software, such as the many DOS games that are available.

At first glance, DOS can be very intimidating - it requires the user to know a cryptic series of words and symbols in order for them to get anything done. Fortunately, these strange incantations are really quite simple, and you'll only need to know a few of them to use DOS effectively.

Just keep in mind that I'm not going to make any assumptions about your ability to use a computer. In other words, you'll likely know about some of the things discussed below.

Files and Folders

Files store information in a digital format. These could contain anything: a picture of the Mona Lisa, a letter to grandma, your progress in a video game, or the code that makes up the game itself. In order to know what a file contains, each file is given a name and extention.

DOS limited file names to just 8 characters, while extentions were limited to 3. This was generally enough to distinguish one file from another.

As you can probably guess, this design would eventually have limitations. In order to organize things futher, users could create folders and place files inside them. This way, files that are related to each other could be stored together in their own virtual "group". Folders can even be nested, so you can get very specific about what each group of files represents.

One of the key concepts you'll need to understand in order to use DOS effectively is the concept of the "working directory", also known as the "current" folder.

In DOS, you're always "inside" a folder. Being inside a folder allows you to access the files within it as if they were commands. Thus, the usual method of running a DOS program is to navigate to its folder, then enter the program's name as a command.

Of course, entering the name of a file that isn't a program will just result in an error message being printed. However, trying to run a Windows program using DOS will also result in an error message - just a different one.

As for how to navigate the file system, this is detailed below in the Everyday DOS Commands section.

Commands and Parameters

As DOS uses a command line, everything in done using commands. To issue a command, type in your desired instruction and press ENTER. This will either run the command or print an error message (usually the unhelpful "bad command or syntax error" message).

Now, commands can be divided into two parts: the command itself, and its parameters. The command is the first word, with each parameter separated by spaces. For example, to display the contents of a file, you'd enter the type command with the file's name as the first and only parameter.

Special parameters begin with - or / . These are known as "switches", and can drastically alter the behavior of the command. An important switch is /?, which tells many programs to print a list of the parameters they accept in a nice, easy to understand way.

Everyday DOS Commands

While DOS featured a plethora of specialized commands, you'll typically only need to use a handful of them in practice. These commonly used commands are listed here. Don't worry too much if you can't remember them all - just bookmark or print out this page and come back here later when you need a refresher.

Command Parameters Mneumonic / Action
cd new_location Change Directory
Move the working directory to a new location in the file system. To go back up the list, use .. as the parameter, or / to return to the top of the folder list.
cls   Clear Screen
Resets the screen. Especially useful if a lot (or too much) information was just printed out.
copy target,
new_location
Copy
Copy a file or folder to a new location.
del target_file_name Delete
Remove the file with the given name. Use *.* as the parameter to erase everything in the current folder.
dir folder_name List Directory
List all of the files within a directory. If the parameter is omitted, this will list the files in the current directory.
mkdir target_folder_name Make Directory
Create a new folder with the provided name.
rename target,
new_name
Rename
Change the name of an existing folder or file.
rmdir target_folder_name Remove Directory
Remove the folder with the provided name. This won't work if the folder contains files or other folders. You'll need to move or delete them first.
type target_file_name Type
Display the contents of a file on the command line. Doesn't work too well on files that aren't plain text.


Lastly, an addition command to keep in mind is the one used to change drives. To change to a different drive, enter the drive's letter followed by : and press ENTER. For example, the command A: will change the current drive to drive A (which is typically a floppy disk). The main hard drive is drive C.

Batch Files

A batch file is a special text file that contains a runnable list of commands. These can be used to store complex commands or a series of commands you've found yourself using over and over again.

All you need to do to create a batch file is create a plain text file (using Notepad or whatever plain text editor you prefer), list the desired commands there, and save it with the .bat file extention.

To use your new batch file, just enter its name as your command.

By the by, there's a ton of fancy stuff you can do with batch files. There are also a bunch of special commands just for use in batch files too, but going into that is completely optional.

In the meantime, here's a small example to show off how they work:

@REM -- An example batch file
@echo Hello World!
@pause
@cls
Just save this text as a batch file and run it. All it does is print the message "Hello World!", wait for a key press, and then clear the screen.

...And that's about it!

As you can see, there's considerably less to know about using DOS than you might expect. Many of the things that users had to deal with back in the day just aren't something we need to bother with anymore, especially if you're using a tool like DosBox.

Something else that often made DOS seem impossible to understand was that many reference guides used to list all of the available commands, creating an imposing wall of text that new users just couldn't penetrate. If you just focus on what the average user needs to know, it's a lot less overwhelming.

Hopefully this page has demystified the DOS command line, and maybe even made you curious about what else you can do with it.