Sunday, October 7, 2007

DOS: What you need to know about directories

A directory is a "table of contents" that lists all the files in an operating system. In DOS when one enters a command the operating system access the file by using the name to look up the track and sector information in the directory.
As seen on the command list posted before...DIR stands for directory, and its function is to list the directory of the disk, thus allowing the user to see the files located on the disk.
TYPE: is Internal thus it is performed by the "command.com."
FORMAT: DIR [d:] [filename [.ext] ] [/p] [/w]

DOS allows the user to create additional directories on a disk. These directories are called SUBDIRECTORIES. The directory that contains them is called the "parent directory."
DOS' three commands for dealing with directories:
1. MD: used to create a new directory
2. RD: to remove a directory (but can only be done if empty)
-DELTREE: allows the user to remove a subdirectory structure even if its NOT empty.
3. CD: allows the user to move from one directory to another. (CD command changes
the active directory.)
4. TREE: display all the subdirectories from any point in the directory tree.


*To move any directory to the root of the drive the user types: ed \
WHY? Because the "\" refers to the root.
*To move from any directory to its immediate parent directory the user types ed ..
WHY? Because the two dots are the way to refer to the parent.
-What does one dot do?
cd. leaves the user in the directory they are in.
-What if one simply enters cd?
It will cause DOS to output a "fully qualified path" (the exact path needed to get to a
file or drive) for the current directory.

No comments: