This section explains how to delete, or
remove, a file that you no longer want on your disk. If you don’t
have very much disk space, deleting
files you no longer use is essential.
To delete a file, you will use the del
command. The del command stands for "delete."
Deleting a File
In this section, you will delete two
files using the del
command.
Before you begin, make sure your
command prompt looks like the following:
C:\FRUIT>
To delete the PEARCOM and PEAR.HLP
files
1. Delete
the PADNOTE.TXT file by typing the following at the command prompt:
del PADNOTE.TXT
2. To confirm that you deleted the
files successfully, type the following at the command prompt:
dir
Deleting a Group of Files
In this section, you will use wildcards
to delete a group of files.
Before you begin this section, make
sure your command prompt looks like the following:
C:\FRUIT>
To delete files in the current
directory that end with the extension OLD by using wildcards
1. View
all files that end with the extension OLD by typing the following at the
command prompt:
dir *.old
A list of all the files that end with
the extension OLD appears. Make sure that these are the files
you want to delete. When you are
deleting files by using wildcards, this step is very important. It
will prevent you from deleting files
accidentally.
2. Delete all files ending with OLD by
typing the following at the command prompt:
del *.old
3. To confirm that all the files with
the extension OLD have been deleted, type the following at the
command prompt:
dir
The FRUIT directory should contain no
files.
Now that the FRUIT directory is empty,
you can delete it by using the rd (remove
directory) command that
you learned to use in "Deleting a
Directory" earlier in this chapter.
To delete the FRUIT directory
1. Return
to the root directory by typing the following at the command prompt:
cd \
2. You
can see the FRUIT directory in the directory list by typing the following at
the command
prompt:
dir or
dir
/p
3. Remove
the FRUIT directory by typing the following at the command prompt:
rd fruit
4. To verify that the FRUIT directory
has been removed, type the following at the command prompt:
dir or
dir
/p
The
FRUIT directory should not appear in the directory list.
Post a Comment
Write Your Precious Comments Here.!