Networking / Beginners

The rm command

The rm command deletes files. The syntax is as follows:

rm [options] file

The options are described in the following paragraphs:

  • -f: Removes files that will be overwritten.
  • -i: Interactively prompts for each file to be overwritten.
  • -R: Copies the contents of subdirectories recursively.

To delete a single file, use it like this:

$ rm any.old.file

To delete multiple files, use a wildcard:

$ rm any.*

To delete an entire directory, use the -r switch:

$ rm -r /doug/old.files
[Previous] [Contents] [Next]