Forrest logo
back to the rm tool

files:directory:delete

Delete a given directory with all child directories.
$ rm -rf ${directory}
try on your machine

The command "rm -rf ${directory}" deletes the directory specified in the variable "directory" along with all its contents.

  • "rm" is the command used to remove or delete files/directories.
  • "-rf" are options for the command that enforce it to remove the directory recursively (including all sub-directories) and force the removal (i.e., do not prompt for confirmation before deleting files).
  • "${directory}" is a variable name used to represent the path or directory name that needs to be deleted. The actual directory name or path is substituted into the variable when the command is executed.
This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the rm tool