Online Book Reader

Home Category

CompTIA A_ Certification All-In-One Exam Guide, Seventh Edition - Michael Meyers [250]

By Root 1600 0
or CD command incorrectly. Take advantage of this knowledge and experiment. Intentionally make mistakes to familiarize yourself with the error messages. Have fun and learn from errors!

To return to the root directory, type CD\ and press ENTER. You can use the CD command to point DOS to any directory. For example, you could type CD\FRED\BACKUP\ TEST from a C:\ prompt, and the prompt would change to C:\FRED\BACKUP\TEST\>—assuming, of course, that your system has a directory called C:\FRED\BACKUP\TEST.

Once the prompt has changed, type DIR again. You should see a different list of files and directories. Every directory holds different files and subdirectories, so when you point DOS to different directories, the DIR command shows you different contents.

The CD command allows you to use a space instead of a backslash, a convenient shortcut. For example, you could go to the C:\WINDOWS directory from the root directory simply by typing CD WINDOWS at the C:\ prompt. You can use the CD [space] command to move one level at a time, like this:

C:\>CD FRED

C:\FRED\>CD BACKUP

C:\FRED\BACKUP>CD TEST

Or, you can jump multiple directory levels in one step, like this:

C:\>CD FRED\BACKUP\TEST

C:\FRED\BACKUP\TEST>

A final trick: If you want to go up a single directory level, you can type CD followed immediately by two periods. So, for example, if you’re in the C:\FRED\BACKUP directory and you want to move up to the C:\FRED directory, you can simply type CD.. and you’ll be there:

C:\FRED\BACKUP>CD..

C:\FRED>

Take some time to move the DOS focus around the directories of your PC, using the CD and DIR commands. Use DIR to find a directory, and then use CD to move the focus to that directory. Remember, CD\ always gets you back to the root directory.

Moving between Drives


The CD command is not used to move between drives. To get the prompt to point to another drive (“point” is command-line geekspeak for “switch its focus”), just type the drive letter and a colon. If the prompt points at the C:\Sierra directory and you want to see what is on the USB thumb drive (E:), just type E: and DOS will point to the USB drive. You’ll see the following on the screen:

C:\Sierra>E:

E:\>

To return to the C: drive, just type C: and you’ll see the following:

E:\>C:

C:\Sierra>

Note that you return to the same directory you left. Just for fun, try typing in a drive letter that you know doesn’t exist. For example, I know that my system doesn’t have a W: drive. If I type in a nonexistent drive on a Windows system, I get the following error:

The system cannot find the drive specified.

Try inserting a floppy disk and using the CD command to point to its drive. Do the same with an optical disc. Type DIR to see the contents of the floppy or optical disc. Type CD to move the focus to any folders on the floppy or optical disc. Now return focus to the C: drive.

Using the DIR, CD, and drive letter commands, you can access any folder on any storage device on your system. Make sure you can use these commands comfortably to navigate inside your computer.

Making Directories


Now that you have learned how to navigate in a command-prompt world, it’s time to start making stuff, beginning with a new directory.

To make a directory, use the MD (or MKDIR) command. To create a directory called STEAM under the root directory C:, for example, first type CD\ to ensure that you are in the root directory. You should see the prompt

C:\>

Now that the prompt points to the root directory, type MD STEAM to create the directory:

C:\>MD STEAM

Once you press ENTER, Windows executes the command, but it won’t volunteer any information about what it did. You must use the DIR command to see that you have, in fact, created a new directory. Note that the STEAM directory in this example is not listed last, as you might expect.

C:\>DIR

Volume in Drive C is

Volume Serial Number is 1734-3234

Directory of C:\

07/12/2007 04:46 AM

Documents and Settings

06/04/2008 10:22 PM

STEAM

09/11/2009 11:32 AM

NVIDIA

08/06/2007 02:28 PM Other Drive

09/14/2007 11:11

Return Main Page Previous Page Next Page

®Online Book Reader