Tuesday, 8 January 2013

Make and Remove Subdirectories


If you are going to have sub directories, there must be a way  to make them. The syntax for
the make directory command is:
MDd:pathname\DIRNAME
You can make a subdirectory IN any directory FROM any directory so long as you give the
appropriate pathname. Usually, you will change to the directory you want the sub directory to be in

and then issue a simple MD DIR NAME command. That way there isno mistake about what will
happen.

When you no longer need a directory you may remove it from the disk. The first thing you
have to do is empty it of files and move out of it. Only then will  you be able to remove it. The
syntax for removing is:
RDd:pathname\DIRNAME
You cannot remove the root directory (it's the master for the disk and when it's the only
directory you would have to be in it, and you can't remove a directory you are in).
Note:In DOS 6.0 the command  DELTREEwas introduced. DELTREE will both remove files
from a directory and remove that directory with a single command.


Mysterious Dots

When you are in a subdirectory and issue the DIR command, you willsee something like
this:



The dots indicate you are in a subdirectory. The single dot is the  current directory and the
double dots are the parent to the current directory. Thus you could  move to the parent of
TUTORIAL (in the example above) by simply issuing the command CD ..
Used with care, the dots can speed up subdirectory commands.


Tree

All directory paths and their relationships are called a tree. If you don't remember the
various subdirectories (and optionally the files in them) DOS offers you a chance to see them with
the TREE command:
TREEd:/f

This command lists all paths from the root on the disk. If you use the/f option, you will also
see all files in each sub directory. (Only the file names are shown, not their size or creation
date/time.)
For a permanent record, press Control-PrtScr before issuing  the TREE command and again after.
Your printer will record all text scrolling past on the screen. (Or redirect to a file with TREE d:/f >
Filename.)

[Note: TREE has been removed under Windows.]

No comments:

Post a Comment