Online Book Reader

Home Category

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

By Root 1506 0
Settings\username>. By typing in DIR and then pressing the ENTER key (remember that you must always press ENTER to execute a command from the command line), you will see something like Figure 15-12.

* * *

NOTE Some commands give you the same result whether you include spaces or not. DIR/P and DIR /P, for example, provide the same output. Some commands, however, require spaces between the command and switches. In general, get into the habit of putting spaces between your command and switches and you won’t run into problems.

Figure 15-12 DIR in a user’s folder

If you are following along on a PC, remember that different computers contain different files and programs, so you will absolutely see something different from what’s shown in Figure 15-12! If a lot of text scrolls quickly down the screen, try typing DIR /P (pause). Don’t forget to press ENTER. The DIR /P command is a lifesaver when you’re looking for something in a large directory.

* * *

NOTE Extra text typed after a command to modify its operation, such as the /W or /P after DIR, is called a switch. Almost all switches can be used simultaneously to modify a command. For example, try typing DIR /W /P.

When you type a simple DIR command, you will see that some of the entries look like this:

09/04/2008 05:51 PM 63,664 bambi.jpg

All of these entries are files. The DIR command lists the creation date, creation time, file size in bytes, filename, and extension. Any entries that look like this are folders:

12/31/2008 10:18 AM

WINDOWS

The DIR command lists the creation date, creation time,

to tell you it is a folder, and the folder name. If you ever see a listing with instead of

, you’re looking at a hard drive partition that’s been mounted as a folder instead of a drive letter:

08/06/2009 02:28 PM Other Drive

Now type the DIR /W command. Note that the DIR /W command shows only the filenames, but they are arranged in five columns across your screen. Finally, type DIR /? to see the screen shown in Figure 15-13, which lists all possible switches for the command.

Figure 15-13 Typing DIR /? lists all possible switches for DIR command

Typing any command followed by a /? brings up a help screen for that particular command. Although these help screens can sometimes seem a little cryptic, they’re useful when you’re not too familiar with a command or you can’t figure out how to get a command to do what you need. Even though I have almost every command memorized, I still refer to these help screens; you should use them as well. If you’re really lost, type HELP at the command prompt for a list of commands you may type. Once you find one, type HELP and then the name of the command. For example, if you type HELP DIR, you’ll see the screen shown in Figure 15-13.

Directories: The CD Command


You can use the CD (or CHDIR) command to change the focus of the command prompt to a different directory. To use the CD command, type CD\ followed by the name of the directory on which you want the prompt to focus. For example, to go to the C:\ OBIWAN directory, you type CD\OBIWAN and then press ENTER. If the system has an OBIWAN directory, the prompt changes focus to that directory and appears as C:\ OBIWAN>. If no OBIWAN directory exists or if you accidentally type something like OBIWAM, you get the error “The system cannot find the path specified.” If only I had a dollar for every time I’ve seen those errors! I usually get them because I’ve typed too fast. If you get this error, check what you typed and try again.

* * *

NOTE Consider errors in general for a moment—not just command-prompt errors such as “Invalid directory,” but any error, including Windows errors. Many new computer users freeze in horror when they see an error message. Do not fear error messages. Error messages are good! Love them. Worship them. They will save you.

Seriously, think how confusing it would be if the computer didn’t tell you when you messed up. Error messages tell you what you did wrong so you can fix it. You absolutely cannot hurt your PC in any way by typing the DIR

Return Main Page Previous Page Next Page

®Online Book Reader