Instructor: Prof. Michael P. Harris Chapter 5

advertisement
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 5
Internal Commands – COPY and TYPE
Chapter 5
Internal Commands — Copy and Type
LEARNING OBJECTIVES
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Explain the purpose and function of internal commands.
Explain the purpose and function of the COPY command.
List the file-naming rules.
Explain the purpose and function of the TYPE command.
Explain when and how to use wildcards with the COPY command.
Explain the purpose and use of subdirectory markers.
Identify the commands that can be used with subdirectories.
Explain when and how files are overwritten.
Explain the function, purpose, and dangers of concatenating files.
Explain setting up Command Line printing in a network lab environment.
Compare and contrast printing files using the TYPE and COPY commands.
STUDENT OUTCOMES
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Copy a file on the same disk using the COPY command.
Use wildcards with the COPY command to copy files on the same disk.
Display a text file using the TYPE command.
Use the COPY command to make additional files on the same disk but in different
subdirectories.
Use wildcards with the COPY command to copy files on the same disk to a different
subdirectory.
Use the COPY and DIR commands with subdirectories.
Use subdirectory markers with commands.
Overwrite a file using the COPY command.
Combine the contents of two or more files using the COPY command.
Explain setting up Command Line printing in some networked lab environments.
Print files.
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
Chapter 5
Internal Commands – COPY and TYPE
CHAPTER SUMMARY
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
One of the major reasons people buy computers is for using application programs that
assist people in different tasks.
Application software usually generates data. Both application software and data are stored
as disk files.
Usually, only a program can use the data files it creates. A data file without the application
program cannot be used.
Another component of the operating system is the commands that allow the user to manage
and manipulate program and data files.
The internal commands DIR, COPY, and TYPE allow you to manage the files on a disk.
The file extensions .COM (command file) and .EXE (executable code) tell the operating
system that the file is a program.
COPY allows you to copy files selectively.
The syntax of the COPY command is:
COPY [drive:][\][path\]filename [drive:][\][path\]filename
A simple way to remember the COPY syntax is:
COPY source destination
Source is what you want to copy. Destination is where you want it copied.
The COPY command never changes the source file.
When naming files, it is best to stick to alphanumeric characters. Certain characters are
illegal, such as the colon (:) and the asterisk (*).
When copying a file to a subdirectory, you must include the path name. The path name and
the file name are separated by the backslash (\), which is used as a delimiter.
The one exception is that the root directory’s name is \ (backslash).
Wildcards may be used with the COPY command.
Files must have unique names when on the same drive and in the same subdirectory, but
files that are copied to different subdirectories may have identical names because the path
makes those file names unique.
TYPE allows you to display the contents of a file on the screen. The syntax is:
TYPE [drive:][\][path\]filename
Wildcards (*, ?) may be used with the TYPE command.
You may use subdirectory markers with the DIR, COPY, and TYPE commands.
If you use *.* with a command, it chooses all the files. Thus, DIR *.* would display
all the files. COPY C:\WHATDIR\*.* F:\ would copy all the files in the WHATDIR
directory to your Flash Drive F:.
When you move between drives, the operating system remembers the last directory you
were in.
Overwriting files with the COPY command is the process in which the contents of the
source file copy over the contents of the destination file.
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
20.
21.
22.
23.
24.
Chapter 5
Internal Commands – COPY and TYPE
Concatenation means combining the contents of files using the COPY command with either
+ or a wildcard. There is only one destination file. You should not concatenate program
files or data files generated from program files.
You may print the contents of an ASCII file by using the PRINT command with the name
of the file or files. You may use multiple file names or use wildcards. Usually the PRINT
command automatically ejects the pages.
Printing in a network lab environment requires special accommodations.
You can print the contents of an ASCII file by typing TYPE filename.ext >LPT1 or
TYPE filename.ext >PRN. If you are on a network, you may need to know the
share-name of your device and it’s UNC… \\servername\sharename. Like this
TYPE filename.ext > \\servername\printername. You may have to
manually eject the page.
You may print the contents of an ASCII file using,
COPY filename.ext LPT1 -orTYPE filename.ext >PRN -orPRINT filename.ext.
KEY TERMS
ASCII
concatenation
destination file
LPT1
overwrite
PRN
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
source file
unformatted text file
Uniform Resource Locator (URL)
Page 3
Download