| Dictionary, Encyclopedia and Thesaurus - The Free Dictionary 3,590,628,761 visitors served. |
Dictionary/ thesaurus | Medical dictionary | Legal dictionary | Financial dictionary | Acronyms | Idioms | Encyclopedia | Wikipedia encyclopedia | ? |
DOS directories |
0.02 sec. |
|
|
DOS directories Directories are simulated file folders on a disk. To understand directory basics, look up DOS abc's.A subdirectory is a directory that is subordinate to (below, or attached to) another directory like BUDGET and TEXT above. Since all directories are below the root directory, all directories are technically subdirectories. The two terms become intertwined. Don't worry about this. More importantly, don't set up too many levels in the hierarchy or you'll drive yourself nuts trying to manage them at the DOS prompt. However, if you have a menu system that let's you point to the directory you want, you can manage several levels of directories more easily. It is tricky because the structure for naming the path isn't clearcut. The culprit is the backslash symbol (\), which means two entirely different things depending on its position in the path. The first time it is used, it stands for root directory. The second and subsequent times, it is a symbol that separates file and directory names. The following commands for creating, removing and changing directories will show you many ways path names are used. There are plenty of examples that follow: C:\ANYWHERE>cd \ go to the root C:\>md karen make directory off the root C:\> you're still in the root To go to that directory, type: C:\>cd karen change directories C:\KAREN> prompt changed to Karen
* C:\ANYWHERE>cd \karen go to KAREN
C:\KAREN>md budget make subdirectory
** C:\KAREN>cd budget go to budget
C:\KAREN\BUDGET> prompt has changed
* Going to KAREN requires a backslash in front of KAREN, because the first backslash means ROOT directory, and KAREN is off the root. ** Going to BUDGET does not use the backslash, because BUDGET is off KAREN, not off the root. More on this in a moment. The following example switches to the KAREN directory, deletes all files, moves back one level and removes the KAREN directory:
C:\>cd karen go to KAREN
C:\KAREN>del *.* delete all files
C:\KAREN>cd .. move back one level
C:\>rd karen remove KAREN directory
Go to the level before it. 2. If you're using DOS 5 or an earlier version, you cannot delete a directory that is not empty. In DOS 6, you can with the use of the Deltree command. Suppose you have three subdirectories under the PLANS directory:
C:\PLANS\1991
C:\PLANS\1992
C:\PLANS\1993
If you're in the 1991 directory and you want to go to the 1992 directory, you have to state the path starting at the root:
C:\PLANS\1991>cd \plans\1992
C:\PLANS\1992>
Another way is to type:
C:\PLANS\1991>cd .. back up one level
** C:\PLANS>cd 1992 go to 1992
C:\PLANS\1992>
**Note: When going from PLANS to 1992, you don't use the backslash (\), because 1992 is subordinate to PLANS, not the root. Let's examine this some more. In the command:
cd \plans\1991
The first \ means ROOT. The second \ separates one directory name from another. Therefore, if you're in PLANS already, you cannot type:
C:\PLANS>cd \1991
You'll get an "Invalid directory" message, because 1991 is not off the root.
\1991 means root 1991
Using the PLANS directories again:
C:\PLANS\1991
C:\PLANS\1992
C:\PLANS\1993
Only the first example below is correct: correct C:\PLANS>cd 1991 1991 is off PLANS no good C:\>cd 1991 You're in the root no good C:\>cd \1991 1991 is not off root For example, to switch from C:\PLANS\1991> to D:\BUDGETS>, you would type:
C:\PLANS\1991>d: switch drives first
D:\>cd budgets then change directories
D:\BUDGETS> prompt has changed
Think of drives as buildings and directories as floors. You cannot get to the 3rd floor of the college if you're on the 2nd floor of the high school by simply switching floors. You have to leave the college and go to the high school first. Drive letters ARE used with all other commands whenever the drives are not implicit. For example, to copy the SALES worksheet from C:\PLANS to D:\BUDGETS, you would type: E:\ANYWHERE>copy c:\plans\sales.wk1 d:\budgets In the above example, notice that, because you're in drive E, both FROM and TO drive letters must be used (C: and D:). Also notice that the SALES file name is simply added to the end of the path, separated by a backslash. If you were already in C:\PLANS, you would only need to reference the file name:
C:\PLANS>copy sales.wk1 d:\budgets
How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content. |
|
| Encyclopedia |
| Free Tools: |
For surfers:
Free toolbar & extensions |
Word of the Day |
Help
For webmasters: Free content | Linking | Lookup box | Double-click lookup | Partner with us |
|---|