Sunday 29 September 2013

DOS Tutorial Lesson 5

A. Delete a Single File.
B. Delete a Group of Files.
C. Delete all Files in a Subdirectory.
D. Remove a Subdirectory.


Delete a Single File

Periodically it is a good idea to delete files from the hard disk which are no longer needed or used. DOS makes it easy to remove these files with the DELETE command, a.k.a. DEL.

Directions:

1. Type: cd.. and press return.
2. The prompt shows you that you are back in the root directory.
3. Type: del sales.bob and press return.
4. Type: dir Sales.bob and press return.
5. Sales.bob 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 you hard drive.

Directions:

1. Type: del quick.* and press return.
2. Type: dir quick.* and press return.
3. 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 root directory. It will destroy all DOS files that are necessary to boot and operate the computer.

Directions:

1. Type: cd \info and press return.
2. Type: dir and press return.
3. Three files should be listed.
4. Type: del *.* and press return.
5. DOS will ask you if you are sure? (Y/N)
6. Type: Y and press enter.

  Now that your subdirectory is empty, you can delete the subdirectory (see rule 2 below).

Remove a 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).

  Directions:

  1. Type: cd.. and press return.
  2. You should be back in the root directory.
  3. Type: rd \info and press return.
  4. Type: dir *. and press return.
  5. Notice that the Info subdirectory is no longer listed.

No comments:

Post a Comment