What command do you use to delete a file? A. rename B. delete C. rm D. cp E. None of the above

rename
delete
rm
cp E. None of the above

The correct answer is C. rm.

The rm command is used to remove files from the filesystem. It can be used to remove individual files or entire directories.

The syntax for the rm command is:

rm [options] file

The options that can be used with the rm command are:

  • -f: Force the removal of the file, even if it is currently in use.
  • -i: Interactively prompt before removing each file.
  • -r: Remove the directory and all of its contents recursively.
  • -v: Verbose mode, print the name of each file being removed.

For example, to remove the file foo.txt, you would use the following command:

rm foo.txt

To remove the directory bar, you would use the following command:

rm -r bar

To remove the directory bar and all of its contents, you would use the following command:

rm -rf bar

The rm command is a powerful tool that should be used with caution. If you remove a file by mistake, it may be difficult to recover.