Home

Getting to Know DOS Directories

|
|  Updated:  
2016-03-26 22:55:24
|   From The Book:  
DOS For Dummies
Explore Book
Buy On Amazon

Computers are supposed to make life easier, not harder. Hard disk management is simply the way you use files on a hard drive. This concept involves some organization, and understanding that organization makes computing much easier.

What is a subdirectory?

A subdirectory is workspace on a disk. It's almost like a disk within a disk. You can copy files and programs into a subdirectory or workspace, and you can use DOS commands. The advantage to subdirectories is that you can store information in a subdirectory and keep it separate from other files on the same disk. That keeps the disk from getting file-messy.

Any disk can have subdirectories, though they're used primarily on hard drives to keep files separate and your programs organized. Rather than let you suffer through a hard drive with bazillions of files all in one place, subdirectories enable you to organize everything by placing information in separate areas.

  • Subdirectories could be called just directories. The prefix sub means "under," just as submarine means any large naval vessel a marine is standing on. All the workspaces on a disk are really directories. However, when you refer to one directory in relation to another, the term subdirectory is used.
  • A subdirectory is the same thing as a folder in Windows terminology.
  • All the directories on your disk create or are organized into what's called a tree structure.

The root directory

Every disk you use under DOS has one main directory, called the root directory. The root directory (often just called the root) exists on all DOS disks; it happens naturally, created when you first format the disk.

The symbol for the root directory is the single backslash (). DOS uses this abbreviation — shorthand — in reference to the root directory. This symbol also plays an important role in the pathname, which is like a long filename.

Additional directories on a disk are subdirectories under the root directory. They branch off the root like branches of a tree. In fact, if you map out the directories on a disk and draw lines between each subdirectory, it looks like a family tree of sorts, as shown in Figure 1.


Figure 1: Subdirectories branch from the root, creating a family tree of sorts.
  • The FORMAT command is used to prepare disks for use under DOS. In the formatting process, FORMAT also creates the root directory.
  • Whenever you're using a disk, you're logged to, or currently using, a directory on that disk.

That funny thing

To find a subdirectory on a disk, you use the DIR command. Directories are listed there, along with other files. The way you identify a directory name is by the

thing shown after its name (where other files would list their file size in bytes).

For example, consider this output from the DIR command:

Volume in drive C is DOS HAPPY
Volume Serial Number is 16CE-9B67
Directory of C:
123

03-18-96 9:33p
COMM 08-07-96 9:37p
DOS 09-20-97 10:52p
GAMES 09-22-97 5:18p
WP60 09-21-97 5:12p
AUTOEXEC BAT 574 09-05-97 10:04a
COMMAND COM 54,928 08-11-93 6:20a
CONFIG SYS 464 07-25-97 10:20a
WIN20 386 9,349 08-11-93 6:20a
9 file(s) 65,315 bytes
36,468,736 bytes free

The "files" 123, COMM, DOS, GAMES, and WP60 are actually directories on disk. At the top of the output in this example, Directory of C: tells you that you're looking at a directory of drive C (that's the C:), the root directory (shown by the backslash). The

entries in the listing are all subdirectories of the root directory.
  • Subdirectories appear in the DIR command's listing because they're part of your disk, just like files. In fact, directories are named just like files and can even have an extension like a file.
  • The C: is actually a pathname.
  • Commas in big numbers appear only if you have MS-DOS 6.2 or later. Early versions of DOS don't use commas, which is just DOS's attempt to overwhelm you with large values.

About This Article

This article is from the book: 

About the book author:

Dan Gookin has been writing about technology for 20 years. He has contributed articles to numerous high-tech magazines and written more than 90 books about personal computing technology, many of them accurate.
He combines his love of writing with his interest in technology to create books that are informative and entertaining, but not boring. Having sold more than 14 million titles translated into more than 30 languages, Dan can attest that his method of crafting computer tomes does seem to work.
Perhaps Dan’s most famous title is the original DOS For Dummies, published in 1991. It became the world’s fastest-selling computer book, at one time moving more copies per week than the New York Times number-one best seller (although, because it’s a reference book, it could not be listed on the NYT best seller list). That book spawned the entire line of For Dummies books, which remains a publishing phenomenon to this day.
Dan’s most recent titles include PCs For Dummies, 9th Edition; Buying a Computer For Dummies, 2005 Edition; Troubleshooting Your PC For Dummies; Dan Gookin’s Naked Windows XP; and Dan Gookin’s Naked Office. He publishes a free weekly computer newsletter, “Weekly Wambooli Salad,” and also maintains the vast and helpful Web site www.wambooli.com.