Ch 2 Command Syntax - Cisco Networking Academy

advertisement
Instructor: Prof. Michael P Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 2
Command Syntax
CHAPTER 2
Command Syntax—
Using the DIR Command with Parameters and Wildcards
LEARNING OBJECTIVES
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Define command syntax.
Explain what parameters are and how they are used.
Explain the purpose and use of the DIR command.
Define prompts and explain how they are used.
Explain the purpose of the CD command.
Explain the purpose and function of a device.
Explain the purpose and function of device names.
Explain the purpose and function of defaults.
Explain the function and purpose of subdirectories (paths).
Explain the use and purpose of wildcards.
Define global specifications and identify their symbols.
Explain the purpose and function of redirection.
STUDENT OUTCOMES
1.
2.
3.
4.
5.
6.
7.
8.
9.
Read a syntax diagram and be able to name and explain what each part signifies.
Use both fixed and variable parameters with the DIR command.
Give the names of the disk drives on your computer.
Change the default drive and the directory.
Use subdirectories (paths) with the DIR command.
Use global specifications with the DIR command.
Use wildcards with the DIR command.
Redirect the output of the DIR command to either a file or a printer.
Use online Help (/?).
CHAPTER SUMMARY
1.
2.
Command syntax means the correct command and the proper order for keying in
commands.
A parameter is some piece of information that you want to include in a command. It allows
a command to be specific.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Page 1
Instructor: Prof. Michael P Harris
ITSC 1405 – Intro to PC Operating Systems
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
Chapter 2
Command Syntax
A delimiter indicates where parts of a command begin or end. It is similar to punctuation
marks in English.
Some commands require parameters. They are called mandatory or required parameters.
Other commands allow parameters; these are called optional parameters.
A variable parameter or switch is one that requires the user to supply a value. A fixed
parameter or switch has its value determined by the OS.
A syntax diagram is a representation of a command and its syntax.
The DIR command is an internal command that displays the directory (table of contents) of
a disk.
DIR has many parameters, all of which are optional.
A file specification has two parts, the file name and the file extension. A file name is
mandatory; however, a file extension is optional. If you use a file extension, separate it
from the file name by a period, called a dot.
A valid file name contains legal characters, most often alphanumeric characters. It cannot
contain illegal characters.
You may use the up or down arrow keys to perform command line editing.
Every device attached to the computer has a reserved, specific, and unique name so that the
operating system knows what it is communicating with.
Disk drives are designated by a letter followed by a colon, as in A:.
A local printer has the device name of PRN, LPT1, LPT2, or LPT3.
Defaults are implied instructions the operating system falls back to when no specific
instructions are given.
The root directory’s name is represented by the \ (backslash).
With some commands, such as DIR, parameters are preceded by a / (slash).
Subdirectories allow a disk to be divided into areas that can hold files.
Subdirectories are named by the user or by an application program.
The system prompt displayed on the screen is the default drive and directory.
You can change the default drive and default subdirectory.
To change the default drive, you key in the drive letter followed by a colon, as in A: or
C:.
To change the default subdirectory, you key in CD followed by the subdirectory name, such
as CD \DATA -or- CD \WINNT\SYSTEM32.
To change directories and drives at the same time, you use the /D parameter, such as
CD /D A:\DATA.
The subdirectory that contains the system utility files is usually \WINDOWS\SYSTEM32 or
\WINNT\SYSTEM32.
You can look for files on drives and subdirectories other than the default if you tell the OS
where to look by prefacing the files names with a drive designator and/or path name.
If the file is in a subdirectory, the file specification must be prefaced by the drive designator
and followed by the subdirectory name. If the default drive \ directory is different than the
location of the needed file, a user must include the subdirectory name in the command, as
in C:\WINNT\SYSTEM32\FILENAME.EXT.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Page 2
Instructor: Prof. Michael P Harris
ITSC 1405 – Intro to PC Operating Systems
28.
29.
30.
31.
32.
33.
Chapter 2
Command Syntax
Global file specifications (* or ?) allow a user to substitute a wildcard for unknown
characters.
The ? wildcard represents any one character in a file name (or none); the * wildcard
matches any string of characters in a file name (or none).
A command’s output that normally is displayed on the screen may be redirected to a file.
You key in the command, add the redirection symbol (>), and then key in the file name.
A command’s output that is normally displayed on the screen may be redirected to a local
printer or a network printer, if you know the network printer name. You key in the
command, add the redirection symbol, and then key in the device name (PRN or LPTn).
To get help for command syntax, key in the name of the command followed by a slash and
a question mark, such as: DIR /?.
The DIR command allows you to sort the directory listing by use of the parameter /O
(Order) followed by the sort order letter you are interested in. For instance, to sort by
name, you would key in: DIR /ON.
KEY TERMS
allias
attributes
backslash
command line editing
convention
default
default drive
delimiter
designated drive
device
device name
documentation
eight-dot-three
extension
FF button
fixed parameter
folders
global file specifications
GUI
illegal characters
insert mode
logged drive
mandatory parameter
OEM
online button
optional parameter
overstrike mode
parameter
path
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
redirection
reset button
root directory
standard input
standard output
subdirectory
subfolders
switch
syntax
syntax diagram
variable parameter
volume
wildcard
Page 3
Download