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.
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
Post a Comment