Create a File with DOS
- 635
Types
- Type: copy can Ham and press Enter.
- Type this message in the following format: IT Series Quality Books for Students.
- Press Ctrl +Z and press return.
- DOS gives you a message that 1 File(s) has copied.
- Type: dir I* and press return.
- You can see the list of files beginning with the letter i.
Copy a File
You can use the COPY command to copy one file to another.
- Type: copy info.text info2.txt and press return.
- DOS will tell you one file has been copied.
- Type: dir q* and press return.
- You should have two files listed with different names.
Note: File names cannot be more than eight characters in length File extensions cannot be more than three characters in length.
Type a File with DOS
If you need to check the contents of a particular file or any DOS file, you will need to use the TYPE command.
1. Type: type quick2.It and press return.
2. DOS prints the contents of the file.
Rename a File
The RENAME command leis you rename a previous file with a new name.
- Type: ren inf02.txt detail.txt and press return.
- Type: dir* text and press return.
- DOS lists the files that have the .txt extension.
Create a Subdirectory
To create a subdirectory, you will need to use the command MD.
- Type: md \info and press return.
- Type: dir * and press return.
- Notice the* will list only the subdirectories.
Move to a Subdirectory
CD command is used to move to a directory.
1. Type: cd\info and press return.
2. Type: cd and press return.
3. The name of the directory is listed.
Move to the Parent Directory
DOS has a quick way to move from the current directory back to the parent directory.
- Type: cd.. and press return.
- You will return back to the C:\> prompt.
Copy a File into a Subdirectory
The COPY command is used to copy files from one directory to another.
- Type: copy sales.txt \info and press return.
- Type: dir \info and press return.
- Notice that a copy of Sales.txt is copied into the subdirectory Info. The original file is also in the root directory.
Copy a Group of Files into a Subdirectory
When copying a group of files from the root directory into a subdirectory, it is necessary to use the wildcard character along with the COPY command.
- Type: copy quick.* \info and press return.
- DOS will list the files being copied.
- Type: dir \info and press return.
- Three files should be listed in the Info subdirectory.
List Subdirectories
1. Type: dir \*. and press return.
2. All the subdirectories are listed.
Note: The backslash character \ directs DOS to read from the root directory. The *. requests the listing of the subdirectories.
Delete a Single File
DEL command is used to delete files.
- Type: cd.. and press return.
- The prompt shows you that you are back in the root directory.
- Type: del sales.bob and press return.
- Type: dir Sales.bob and press return.
- Salesbob is no longer listed because it has been deleted.
Delete a Group of Files
By using the wildcard character you can_delete a group of files from Your hard drive.
- Type: del quick.* and press return.
- Type: dir quick.* and press return.
- All Quick files have been deleted.
Delete all Files in a Subdirectory
There are two rules you will need to follow before removing a subdirectory.
RULE 1: All files in the subdirectory must be deleted.
NOTE: Never type DEL *.* when you are in the foot directory. It will destroy all DOS files that are necessary to boot and operate the computer.
- Type: Ed \info and press return.
- Type: dir and press return.
- Three files should be listed.
- Type: del *.* and press return.
- DOS will ask you if you are sure? (YIN)
- Type: Y and press enter.
Now the subdirectory is empty, you can delete the subdirectory.
RULE 2: You cannot be in the subdirectory that you wish to remove. You will need to return to the root directory (C:\> prompt).
- Type: cd.. and press return.
- You should be back in the root directory.
- Type: rd \info and press return.
- Type: dir *. and press return.
- Notice that the Info subdirectory is no longer listed.