Languages
[Edit]
EN

Bash - remove directory

3 points
Created by:
Dirask Admin - Marvin
1820

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

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