Presentation is loading. Please wait.

Presentation is loading. Please wait.

Command Prompt Using Copy, Type, and Wildcards

Similar presentations


Presentation on theme: "Command Prompt Using Copy, Type, and Wildcards"— Presentation transcript:

1 Command Prompt Using Copy, Type, and Wildcards
©Richard Goldman January 18, 2000

2 Copy Command Makes a copy of a file(s) and places it (them) where you want. Logic: COPY Source Destination Syntax: Copy [drive:][path]filename [drive][path]filename Example: C:>Copy A:\Students\John.new D:\Grads\Smith.C00

3 File-naming Rules .COM, .EXE, .SYS, (.BAT)
File names in a directory must be unique. File length Dos 6.22 and earlier – 8.3 Win 95 and later – 255 characters (LFN that include spaces must be enclosed in quotes) File extensions optional Illegal characters “ / \ : | > < * ? Common program file extensions .COM, .EXE, .SYS, (.BAT)

4 Using Long File Names Don’t use unless necessary
They fill up the directory table very fast Directory Listings (/X) 8.3 versions displayed on left LFN versions displayed on right Truncated LFN’s are displayed with shortened name appended with a tilde (~) and a number. Random numbers are used in the name after the 4th. RICHAR~1.ABC RICHARD GOLDMAN MATH.ABC RICHAR~2.ABC RICHARD GOLDMAN SCIENCE.ABC RICHAR~3.ABC RICHARD GOLDMAN HEALTH.ABC RICHAR~4.ABC RICHARD GOLDMAN ENGLISH.ABC RI3491~1.ABC RICHARD GOLDMAN CHEMISTRY.ABC RI3492~1.ABC RICHARD GOLDMAN BIOLOGY.ABC Use quotes to enclose LFN’s with imbedded spaces. C:\>COPY “Jack and Jill.fun” A:JaJ.fun

5 Using Wildcards with Copy
C:\>COPY *.TMP A:*.NEW Copies all files with a .TMP extension from the root drive of C: to the root drive of A: In the process it changes the extension of the copied files to .NEW.

6 The Type Command Type displays the contents of a file on the screen.
Type is an Internal command. Syntax: TYPE [drive:][path]filename Example: C:>TYPE A:\Students\John.new

7 . (Single Dot) = Current directory .. (Double Dot) = Parent directory
Subdirectory Markers . (Single Dot) = Current directory .. (Double Dot) = Parent directory As a shortcut, you may substitute .. In the command line for the name or the parent directory.

8 Overwriting with the Copy Command
Copying a file to a different directory that contains a file with the same name allows you to overwrite (replace) the original file. DOS will ask you if you are about to overwrite a file. If you answer Yes – the specific file will be replaced. If you answer No – that specific COPY will be aborted. If you have selected multiple files and answer All – then all files will be replaced.

9 Combining Text Files with Copy
Concatenation is a method of creating a new file out of two or more smaller files. Normally concatenated files should only be used with text files. Syntax: COPY Source1 + Source2 Destination Example: C:>Copy A:\1HW + A:\2HW C:\Ch5.NEW


Download ppt "Command Prompt Using Copy, Type, and Wildcards"

Similar presentations


Ads by Google