690 likes | 859 Views
Chapter 5. Internal Commands COPY and TYPE. Overview. Will review file-naming rules. Overview. Will learn some internal commands that can be used to manage and manipulate files. Overview. The value of creating and using dummy files will be explained. Overview.
E N D
Chapter 5 Internal Commands COPY and TYPE Ch 5
Overview Will review file-naming rules. Ch 5
Overview Will learn some internal commands that can be used to manage and manipulate files. Ch 5
Overview The value of creating and using dummy files will be explained. Ch 5
Overview Will experience naming, managing, manipulating, viewing, and printing files. Ch 5
Overview Use COPY and TYPE commands to perform various tasks. Ch 5
Overview Both concatenation and the consequences of overwriting files will be discussed. Ch 5
Why Learn Command Line Commands? Review of directory management commands: • MD • CD • RD Ch 5
Why Learn Command Line Commands? Directories: • Largest units of information management • Used to organize programs and data files Ch 5
Why Learn Command Line Commands? • Need to know how to manage information at the file level. • Managing files different from creating/changing data within files. Ch 5
Why Learn Command Line Commands? Using the command line will help you understand: • File manipulation • Disk and subdirectory structure Ch 5
Why Learn Command Line Commands? Some tasks are done easier and faster at the command line. Ch 5
Why Learn Command Line Commands? Internal file-management commands: • DIR • COPY • REN • DEL • TYPE Ch 5
The COPY Command COPY command: • Used to copy files from one place to another Ch 5
The 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
The COPY Command COPY command syntax: COPY [parameters] [drive:] [path] filename [drive:] [path] filename [parameters] Ch 5
The COPY Command Conceptually the syntax is: COPY source destination Ch 5
Review 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
Review of File-Naming Rules File-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
Review of File-Naming Rules Program files: • Named by programmer • Commonly have .COM, .EXE, or .BAT extensions Ch 5
Review of File-Naming Rules 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
Activity—Making Copies 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
Activity—Making Copies of Files KEY CONCEPTS: • Executed several COPY commands • Used DIR to confirm files copied • Copy and rename files • On command line - one step • Windows Explorer and My Computer - two steps Ch 5
Using 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
Using 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
Using Long File NamesFig 5.1 Two Directory Tables p. 192 Ch 5
Using 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
Using Long File NamesFig 5.2 Directory Showing Short and Long File Names p. 192 Ch 5
Using 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
Activity—Copying Files with Long File Names KEY CONCEPTS: • Copied file to data disk • Operating system assigned alias (8.3 file name) Ch 5
Using Wildcards with the COPY 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
Using Wildcards with the COPY Command Wildcards used: • With DIR and COPY commands • To change destination name Ch 5
Activity—Using Wildcards with 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
The 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
The TYPE Command TYPE command syntax: TYPE [drive:] [path] filename Ch 5
Activity—Displaying Files Using TYPE Command KEY CONCEPTS: • Text files/ASCII files • Recognizing executable code files by file extensions • Support files • Format - how data is arranged Ch 5
Dummy Files Dummy files: • Files without particular meaning • Usually created for test purposes • Usually smaller and are samples Ch 5
Activity—Using the Copy and Type Commands KEY CONCEPTS: • TYPE can use more than one parameter • DIR - displays current files on disks • TYPE - displays contents of one file at a time Ch 5
Making Additional Files on 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
Activity - Using COPY Command KEY CONCEPTS: • Review use of: • MD and <DIR> (including syntax) • Naming subdirectories • First backslash (\), other (\) • Dot (.) and double dot (. .) • Absolute/relative paths • COPY command • Use of wildcards with TYPE command Ch 5
Using Wildcards with the COPY Command Wildcards can be used to copy files in the same drive to a different subdirectory. Ch 5
Using Wildcards with the COPY Command It is crucial that syntax is NEVER altered. COPY source destination Ch 5
Using Wildcards with the COPY Command Files can be “misplaced”: • Computers always follow commands • User must know what the computer was told to do Ch 5
Activity—Using Wildcards with 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
Using COPY and DIR with Subdirectories • COPY command can place file in subdirectories. • DIR command can be used to see if files were copied. Ch 5
Activity—Using COPY with 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
Using Subdirectory Markers with the COPY Command Can use shortcuts to write commands: • Dot (.) • Double dot (..) Ch 5
Using Subdirectory Markers with the COPY Command • The .. represents parent of current directory. • Only directory that does not have a parent is the root directory. Ch 5
Activity—Using Shortcuts: The Subdirectory Marker KEY CONCEPTS: • Child vs. parent directory • Absolute path • Using . . • Using \ as a delimiter Ch 5
Overwriting Files with the COPY Command Each file must have a unique name on same disk and subdirectory. Ch 5