Introduction to Linux 407
B.5.6 The rm Command
The rm command will remove (delete) a file from the directory where it is cur-
rently located. The command has the following format:
rm [options] filename
This command will remove (delete) the specified file from the current directory.
The following example shows the use of the rm command.
rm rrsched.cpp
rm mydat/
*
.dat
The first line in the example deletes file rrsched.cpp from the current work-
ing directory. The second line removes all the files whose names end with .dat. The
most common options of the rm command are the following. Interactive option -i,
which prompts the user when a file will be removed. Recursive option -r, which will
remove the entire directories (all their files). Verbose -v, which displays ...