Download - Internal Commands COPY and TYPE
Ch 5 1
Internal CommandsCOPY and TYPE
Ch 5 2
OverviewOverview
Will review file-naming rules.
Ch 5 3
OverviewOverview
Will learn some internal commands that can be used to manage and manipulate
files.
Ch 5 4
OverviewOverview
The value of creating and using dummy files will be
explained.
Ch 5 5
OverviewOverview
Will experience naming, managing, manipulating,
viewing, and printing files.
Ch 5 6
OverviewOverview
Use COPY and TYPE commands to perform various
tasks.
Ch 5 7
OverviewOverview
Both concatenation and the consequences of overwriting
files will be discussed.
Ch 5 8
Why Learn Command Why Learn Command Line Commands?Line Commands?
Review of directory management commands:
MD CD RD
Ch 5 9
Why Learn Command Why Learn Command Line Commands?Line Commands?
Directories: Largest units of information
management Used to organize programs and
data files
Ch 5 10
Why Learn Command Why Learn Command Line Commands?Line Commands?
Need to know how to manage information at the file level.
Managing files different from creating/changing data within files.
Ch 5 11
Why Learn Command Why Learn Command Line Commands?Line Commands?
Using the command line will help you understand:
File manipulation Disk and subdirectory structure
Ch 5 12
Why Learn Command Why Learn Command Line Commands?Line Commands?
Some tasks are done easier and faster at the command line.
Ch 5 13
Why Learn Command Why Learn Command Line Commands?Line Commands?
Internal file-management commands: DIR COPY REN DEL TYPE
Ch 5 14
The COPY CommandThe COPY Command
COPY command: Used to copy files from one
place to another
Ch 5 15
The COPY CommandThe COPY Command
Reasons for copying files: Copy files from one disk to another Make second copy to existing file on same
disk Copy file to device Making changes of existing file with
program that created it Create backup copy of various data files
Ch 5 16
The COPY CommandThe COPY Command
COPY command syntax:
COPY [parameters] [drive:] [path] filename
[drive:] [path] filename [parameters]
Ch 5 17
The COPY CommandThe COPY Command
Conceptually the syntax is:
COPY source destination
Ch 5 18
Review of File-Naming RulesReview of File-Naming Rules
File-naming Rules: Names of files in directory must be unique. No names can be longer than 255
characters, including file extensions. File extensions are optional.
Ch 5 19
Review of File-Naming RulesReview of File-Naming RulesFile-naming Rules: File name must be separated from its extension
with a period, called a dot. All alphanumeric characters can be used in file
names and extensions, except the following illegal characters:
“ / \ : | < > * ? +
Ch 5 20
Review of File-Naming Review of File-Naming RulesRules
Program files: Named by programmer Commonly have .COM, .EXE,
or .BAT extensions
Ch 5 21
Review of File-Naming Review of File-Naming RulesRules
Naming data files: Use names that reflect file contents Extensions usually specify type of file Most application programs assign file
extension to data files
Ch 5 22
Activity—Making Activity—Making Copies of FilesCopies of Files
KEY CONCEPTS: Function keys correct typing errors Function of first \ and second \ Function of dot (.) between file name and file
extension : lets operating system know that the destination
is a drive
Ch 5 23
Activity—Making Activity—Making Copies of FilesCopies of Files
KEY CONCEPTS:Executed several COPY commandsUsed DIR to confirm files copied Copy and rename files
On command line - one step Windows Explorer and My Computer - two
steps
Ch 5 24
Using Long File NamesUsing Long File Names
Floppy disk: Long file names - only when
necessary Room for 224 files on Directory
Table Uses old FAT16 file system
Ch 5 25
Using Long File NamesUsing Long File Names
Floppy disk: Designed to hold files with 8.3
rules Directory table full - cannot add
files to disk (even if there is room)
Ch 5 26
Using Long File NamesUsing Long File NamesFig 5.1 Two Directory Tables p. 192Fig 5.1 Two Directory Tables p. 192
Ch 5 27
Using Long File NamesUsing Long File Names
At command line enclose entire file name in quotes if it has spaces.
Use /X with DIR to see both short and long name in directory.
Ch 5 28
Using Long File NamesUsing Long File NamesFig 5.2 Directory Showing Short and Long File Names p. 192Fig 5.2 Directory Showing Short and Long File Names p. 192
Ch 5 29
Using Long File NamesUsing Long File Names
For long files names, it is helpful to have meaningful and unique characters within the first six
characters of the name.
Ch 5 30
Activity—Copying Files Activity—Copying Files with Long File Nameswith Long File Names
KEY CONCEPTS: Copied file to data disk Operating system assigned alias (8.3
file name)
Ch 5 31
Using Wildcards with the Using Wildcards with the COPY CommandCOPY Command
Using wildcards (* and ?) with the COPY command to copy
files can reduce the number of commands that have to be
typed in.
Ch 5 32
Using Wildcards with the Using Wildcards with the COPY CommandCOPY Command
Wildcards used: With DIR and COPY commands To change destination name
Ch 5 33
Activity—Using Wildcards Activity—Using Wildcards with COPY Commandwith COPY Command
KEY CONCEPTS: Use wildcards to save time when:
Copying files Viewing files
If NTFS is file system - copy will copy files in alphabetical order
Ch 5 34
The TYPE CommandThe TYPE Command
TYPE command: Internal command Opens/displays contents of file on screen
DIR - displays what files are on disk Must be text/ASCII file for data to be
meaningful and readable
Ch 5 35
The TYPE CommandThe TYPE Command
TYPE command syntax:
TYPE [drive:] [path] filename
Ch 5 36
Activity—Displaying Files Activity—Displaying Files Using TYPE CommandUsing TYPE Command
KEY CONCEPTS: Text files/ASCII files Recognizing executable code files by
file extensions Support files Format - how data is arranged
Ch 5 37
Dummy FilesDummy Files
Dummy files: Files without particular meaning Usually created for test purposes Usually smaller and are samples
Ch 5 38
Activity—Using the Copy Activity—Using the Copy and Type Commandsand Type Commands
KEY CONCEPTS:TYPE can use more than one
parameterDIR - displays current files on disksTYPE - displays contents of one file at
a time
Ch 5 39
Making Additional Files Making Additional Files on the Same Diskon the Same Disk
Can have two files with identical contents on same disk:
Including same name - if files kept in different subdirectories
In same subdirectory - if the names of the files are different.
Ch 5 40
Activity - Activity - UsingUsing COPY Command COPY CommandKEY CONCEPTS:
Review use of: MD and <DIR> (including syntax) Naming subdirectories First backslash (\), other (\) Dot (.) and double dot (. .) Absolute/relative paths
COPY commandUse of wildcards with TYPE
command
Ch 5 41
Using Wildcards with the Using Wildcards with the COPY CommandCOPY Command
Wildcards can be used to copy files in the same drive to a
different subdirectory.
Ch 5 42
Using Wildcards with the Using Wildcards with the COPY CommandCOPY Command
It is crucial that syntax is NEVER altered.
COPY source destination
Ch 5 43
Using Wildcards with the Using Wildcards with the COPY CommandCOPY Command
Files can be “misplaced”: Computers always follow
commands User must know what the
computer was told to do
Ch 5 44
Activity—Using Wildcards Activity—Using Wildcards with the COPY commandwith the COPY command
KEY CONCEPTS: Copying/naming files with COPY
command Compare moving/renaming files using
GUI vs. doing it at the command line
Ch 5 45
Using COPY and DIR Using COPY and DIR with Subdirectorieswith Subdirectories
COPY command can place file in subdirectories.
DIR command can be used to see if files were copied.
Ch 5 46
Activity—Using COPY Activity—Using COPY with Subdirectorieswith Subdirectories
KEY CONCEPTS: Importance of spacing when keying in
commands (COPY command spacing) Use of \ - as a root, as a delimiter When to use absolute/ relative path Changing directories Using DIR to locate files
Ch 5 47
Using Subdirectory Markers Using Subdirectory Markers with the COPY Commandwith the COPY Command
Can use shortcuts to write commands:
Dot (.) Double dot (..)
Ch 5 48
Using Subdirectory Markers Using Subdirectory Markers with the COPY Commandwith the COPY Command
The .. represents parent of current directory.
Only directory that does not have a parent is the root directory.
Ch 5 49
Activity—Using Shortcuts: The Activity—Using Shortcuts: The Subdirectory MarkerSubdirectory Marker
KEY CONCEPTS: Child vs. parent directory Absolute path Using . . Using \ as a delimiter
Ch 5 50
Overwriting Files with the Overwriting Files with the COPY CommandCOPY Command
Each file must have a unique name on same disk and
subdirectory.
Ch 5 51
Overwriting Files with the Overwriting Files with the COPY CommandCOPY Command
Overwrite: Old data replaced by new data
Ch 5 52
Overwriting Files with the Overwriting Files with the COPY CommandCOPY CommandFig 5.4 Overwriting Files p. 264Fig 5.4 Overwriting Files p. 264
Ch 5 53
Overwriting Files with the Overwriting Files with the COPY CommandCOPY Command
Overwrite files on regular basis as you want to backup files.
Now Windows informs user that an overwrite will occur.
Ch 5 54
Activity—Overwriting Files Activity—Overwriting Files Using COPY CommandUsing COPY Command
KEY CONCEPTS: When overwriting is not allowed Confirmation prior to overwriting
Ch 5 55
Combining Text Files with Combining Text Files with the COPY Commandthe COPY Command
Concatenation is creating another file by combining contents of
two or more text (ASCII) files.
Ch 5 56
Combining Text Files with Combining Text Files with the COPY Commandthe COPY Command
Concatenation should never be done with program files, or with data files generated by
programs.
Ch 5 57
Combining Text Files with Combining Text Files with the COPY Commandthe COPY Command
To avoid accidental concatenation of files, read all messages DOS displays on the
screen.
Ch 5 58
Combining Text Files with Combining Text Files with the COPY Commandthe COPY Command
COPY syntax never changes: COPY source destination
Plus sign (+) between source files tells OS that you are joining files.
Two or more items separated by pipe symbol (|) - either/or choice
Ch 5 59
Activity—Combining Files Activity—Combining Files Using the COPY CommandUsing the COPY Command
KEY CONCEPTS: Where spaces are in COPY command Join text files with plus sign Never concatenate:
Program files Data files created with application programs
Read messagesOnly text files can be combined
Wildcards can be used
Ch 5 60
Printing FilesPrinting Files Have not printed contents of any file.
May have: Redirected output to printer using:
DIR command TYPE command
Copied file to printer
Ch 5 61
Printing FilesPrinting Files
PRINT command: Prints contents of files Automatically ejects pages Works only for ASCII files
Ch 5 62
Printing FilesPrinting Files
Data files generated by application programs can only
be printed from within application program.
Ch 5 63
Printing FilesPrinting Files
Reasons for printing ASCII files: Need hard copy of configuration
information on computer Verify if printer problem is a
software problem
Ch 5 64
Printing FilesPrinting Files
Three ways to print a text file from the command line:
Use PRINT command Use redirection with DIR
command Copy contents of file to printer
Ch 5 65
Printing FilesPrinting Files
PRINT command syntax:
PRINT [D:device] [[drive:] [path] filename […]]
Ch 5 66
Printing in a Lab Printing in a Lab EnvironmentEnvironment
Printing is complicated without a local printer.
Ch 5 67
Activity- Setting Up Printing Activity- Setting Up Printing in a Lab Environmentin a Lab Environment
KEY CONCEPTS: Created shortcut to enable printing on
the desktop Created second shortcut on desktop to
disable command line printing
Ch 5 68
Activity—Printing FilesActivity—Printing Files
KEY CONCEPTS: Print job Status report Can direct output to screen or another
device Cannot use redirection with COPY
command