fast and secure web hosting. from a simple website to a highly visited e-shop  

How to delete a directory via SSH

Many new Linux / Unix users may wonder how to delete an entire directory / folder and all its contents via SSH. Here is the answer:

rm -rf ./direcory_to_delete

You may use "wildcards" too, for example:

rm -rf ./direcory_that_starts_with*

What every command does:

  • rm → delete / remove
  • r    → recursively
  • f    → don't ask for confirmation