Remove a folder in Linux

This is the command to remove a folder/directory including its contents, use with caution as you wont get an “are you sure” prompt

rm -rf example

In the above example it would delete a folder/directory called example. Just change that to your folder/directory name.

The below code will do the same as above, but you will be prompted are you sure for each deletion.

rm -r example

 

Was this post helpful?

Total Page Visits: 443 - Today Page Visits: 2