Skip to main content

Making, Changing, and Removing Directories

You used the DIR (directory) command in Section 3 to display a list of filenames on the screen. You can create and name multiple disk directories on a disk to allow for the subdivision of your files. This feature lets you group common files into separate directories. This is similar to subdividing information into file cabinet drawers and file folders. This is particularly convenient when you use a fixed disk containing hundreds or even thousands of files. Instead of listing all
files in one directory, you can list files in smaller, more manageable sub directories. Lock at the following directory commands.

Command                                      Purpose
                  MKDIR or MD                                Make a new directory
                  CHDIR or CD                                Change to another directory 
                  RMDIR or RD                                Remove (or delete) a directory from the disk

Each sub directory is assigned a unique path name. Therefore, you might create a word processing path name, a database manager path name, a spreadsheet path name, and so on.

Sub directories Imagine your directory structure in the shape of an inverted tree. There is a main directory (the root) and sub directories (the branches). This relationship is often referred to as parent and children directories. The following illustration shows a typical directory structure.


Notice that the Bill directory has two sub directories. Therefore, Bill is a parent to LilBill and WmJr. Both Lil Bill and WmJr can also have sub directories, or children, as required. Once directories are created with the MKDIR (or MD) command, you can move in and out of the
directories with the CHDIR (or CD) command. You can remove directories with the RMDIR (or RD) command. These three commands are described in the following paragraphs.

The MKDIR Command: The MKDIR (or MD) command is used to make (or create) a new sub directory that is subordinate to the currently logged directory. To make a sub directory having the pathname WP (for word processing), log your root directory, type MKDIR WP, and press
Enter. You may prefer the short form of this command, which is MD. If you lisi a directory of the disk containing your new WP sub directory, the sub directory listing is displayed:
                                      W? <DIR> 6-07-83 11:25p

The CHDIR Command: The CHDIR (or CD) command is used to change from one directory to another. If you are in the root directory and wish to move down to the BILL directory, type CD BILL and press Enter.

To move to WMJR (one level down), use CD WMIR O: CD\BILL\WMJR and Enter. To move back up to the parent (one directory level up), type CD .. and press Enter. To move to tie root
directory from any logged sub directory; use CD. You can move directly to any directory (or file path) from another by including the complete path name in your CD command. For example, the command CD\BILLI\WMJR takes you directly to the C:\BILL\WMIR file path
from any logged location.

The RMDIR Command The RMDIR (or RD) command is used to
remove a sub directory. First you must delete all files within a
sub directory before it can be deleted. If necessary, you can copy the
files you want to retain to another directory with the COPY command.
Then delete all files from the sub directory you want to remove. To
remove an empty sub directory having the path name WP, go to the
directory immediately above the one to be removed, type RD WP, and
press Enter.

The following two lines are common to a sub directory display.
                  .                        <DIR>            1-01-91         1:44a
                      ..                       <DIR>            1-01-91         1:44a

                                             2 File(s)                        28560 bytes free


The single dot represents the directory being listed, while the double dot indicates the parent directory. With some versions of DOS, you can list the parent directory by typing DIR .. and pressing Enter. You can list the local directory by typing DIR. and pressing Enter, although the
period (.) is superfluous. Regardless of the currently logged directory, you can view the files in
another sub directory by using a command like DIR BILL\WMJR. Notice that the backslash tells DOS that the entry is a directory name rather than a filename.


Comments

Popular posts from this blog

MEM

MEM The MEM command was introduced in DOS version 4.01 and memory information. The MEM command is entered alone or with a modified slightly in MS-DOS 5.00. MEM is used to display system memory information. The MEM command is entered alone or with a parameter. MEM-Displays to all system memory values, including expanded and extended memory values. MEM PROGRAM--Displays programs presently loaded in memory with used and unused memory. You may use /P if you are using DOS 5.00 MEM/DEBUG--Dispiays a list of programs, device drivers, install drivers, and used unused memory. You may use / if you are using DOS 5.00. MEM CLASSIFY (or MEM /C)-Displays programs and cor-responding memory usage. The largest available memory block is also displayed. You may use /C if you are using DOS 5.00. Typing MEM and pressing Enter displays information similar to the following (typical of DOS 5.00): C:\>MEM                  ...

Disk Construction

The various parts of standard 5.25- and 3.5-inch disks are contained in Figure 1-2. A description of each part is also provided. Write protect notch--When covered, prevents information from being recorded on the disk; when uncovered, information can be recorded. Temporary label--An adhesive-backed label allowing the contents of a disk to be identified. Permanent label--When used, contains disk manufacturer and capacity information. Exposed recording surface--Metal oxide surface used to magnetically record data. Do not touch! Protective jacket --House magnetic disk; provides protective cover. Disk sleeve (envelope)--Used to store disks;prevents  accidental contact with exposed surface. Protective slide --Protects magnetic media surface; slides open when inserted into a diskette drive (only on 3 1/2-inch diskettes). Figure 1-2 The Parts of a Floppy Disk Construction : Almost everyone is familiar with audio recording tape. The tape is a long, flexible acetate or mylar strip coated wit...

DOS CONFIGURATION AND AUTOMATIC EXECUTION FILES

The CONFIG.SYS and AUTOEXEC.BAT files can be used to set the way your computer responds to commands. The purpose of each of these files is briefly described. Although these files are not always essential to the proper operation of your computer, there are certain programs that depend on their presence. At this point in your exploration of DOS, you are not expected to make use of these commands. However, it is important to know what they are and how they can be used. When you finish this blog, you may wish to experiment with the effect of these files on the way your computer interacts with certain programs, its operating speed, and the allocation of memory. CONFIG.SYS When your computer is turned on, DOS  checks for a CONFIG.SYS file and adjusts your computor's configuration according to commands contained in that file. The CONFIG.SYS file is always found on the main directory of the DOS book disk. If you have a hard disk system, it is found on drive C, although you can boot from ...