Languages
[Edit]
EN

Bash - remove directory

3 points
Created by:
marc_so
1014

This article will show you how to remove a directory using Bash under Linux / Unix or Windows.

Quick solution:

rm -r ./DirectoryToDelete

Note: the -r flag causes the operation to be performed recursively - files inside a directory are also deleted

or:

rm -r /path/to/DirectoryToDelete

 

Practical example

In this example, we used Bash run under Windows (installation instruction here).

Directory removing under Bash with rm -r command.
Directory removing under Bash with rm -r command.

Screenshots

Before:

Before operation: rm -r ./DirectoryToDelete
Before operation: rm -r ./DirectoryToDelete

 

After:

After operation: rm -r ./DirectoryToDelete
After operation: rm -r ./DirectoryToDelete

See also

  1. Bash - how to install linux bash for windows 

References

  1. rm command manual - die.net

Alternative titles

  1. Bash - delete directory
  2. Bash - remove directory recursively
  3. Bash - remove not empty directory
  4. Bash - remove directory with content
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - remove directory
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join