How to Name a Directory (the MKDIR Command)
Directories are given names just like files. They can contain numbers an letters, and they can have up to eight characters, plus an optional period and a three-letter extension. As a rule, however, directories usually lack extensions.
Making Directories
Directories are named as they're created. You do this by using the MD command. Here's an example:
C> MD JUNK
This command is MD, for Make Directory, followed by a space and the name of the directory to create. In this case, DOS creates a subdirectory named JUNK.
Renaming a directory
OK, everyone makes mistakes. Just as you can rename a file, you can rename a directory after its been created. The insanity here is that, unlike renaming a file, you don't use the REN command. Instead, to rename a directory, you use the MOVE command. To wit:
C> MOVE JUNK TRASH
The MOVE command is followed by a space and the name of the directory you want to rename. Then comes another space and the directory's new name (following proper file naming procedures of course). In this example, the directory named JUNK is renamed to the more apropos TRASH. Something like the following would be displayed on your screen.
C:\JUNK => C:\TRASH [ok]
That "OK" means that the directory was successfully renamed.
Because this trick uses the MOVE command, and because that command is only available with DOS 6, well you get the idea.
No, nothing is moved here, the directory is just renamed.
It's typically not a healthy idea to go around renaming directories. The reason is that many programs are set up to find certain directory names, and changing them makes the computer mess up.
Using the DIR Command
The DIR command is used to see a list of files on disk. You just type DIR and press Enter:
C> DIR
The files are listed in a special format, shown with their size and date and time of creation or last update. But note that the special format separates the filename form the extension, padding the distance between them with spaces. Although this lines up the directory listing nice and pretty, it doesn't show you how to accurately type in the filename.
To see a list of files on another drive, use the DIR command with the drive letter and a colon:
C> DIR A:
In this example, you'll see a listing of all files on the disk in drive A. If you want to look at drive B, substitute B: for A:
To see a list of files in another directory on the same disk, specify that directories pathname after the DIR command:
C> DIR \WP60|DATA
Here the DIR command lists all the files in the \WP60\data subdirectory.
To see a single file's information, just type the file's name after the DIR command:
C> DIR BLOOP.NOF
Here the DIR command is followed by the file named BLOOP.NOF. Only that single file (and its associated and miscellaneous information) will be displayed.
To see only a specific group of files, follow the DIR command with the proper, matching wildcard:
C> DIR *.COM
In this example, DIR is followed by a space, an asterisk, a period, and then COM. This command displays only those files with the COM extension.
The wide DIR command
When you long for the wide open spaces of the Big Sky country, you can use the following DIR command:
C> DIR /W
That's the DIR command, a space, and slash-W. Pressing Enter displays the directory listing in the wide format, with only the filenames marching across the screen five abreast.
If you want to display a wide directory of another drive or a subdirectory, sandwich the drive letter or subdirectory pathname between the DIR and the /W. For example:
C> DIR A: /W
Or:
C> DIR \WP60\DATA /W
Making DIR display one screen at a time
When the DIR command scrolls and scrolls, rolling up and up the screen and you cannot find the file. You can use the following DIR command at the next DOS prompt:
C> DIR /P
That's the DIR command, followed by a space and a slash-P. The P means page or pause, and DOS will insert a friendly press any key message after each screen of filenames. Press the spacebar to continue.
To cancel the listing, press Ctrl-C.
If you're just hunting down a specific file, follow the DIR command with that filename.
You can use this DIR command to see a directory listing of another drive or subdirectory. Just sandwich that drive letter or subdirectory pathname between DIR and the /P. Here's an example:
C> DIR A: /P
Or:
C> DIR \WP60\DATA /P
Displaying a sorted directory
When DOS displays a list of files, it shows them to you in any old order. To sort the files in the listing alphabetically, use the following DIR command:
C> DIR /O
That's the DIR command, a space, and then slash-O.
|