How do I delete the following directory?
I typed:
rmdir lampp
This error comes up:
rmdir: failed to remove `lampp': Directory not empty
Is there a command to delete all the files in the directory and delete the directory folder?
|
How do I delete the following directory? I typed:
This error comes up:
Is there a command to delete all the files in the directory and delete the directory folder? |
||||
Use the below command :
It deletes all files and folders contained in the In case user doesn't have the permission to delete the folder:Add
Otherwise, without
Note: this is assuming you are already on the same level of the folder you want to delete in terminal, if not:
FYI: you can use letters
|
|||||||||||||
|
However, you need to be careful with this command, as it makes it easy to accidentally delete a lot more than you intended. It is a good idea to always double-check which directory you're in, and whether you typed the command correctly, before pressing Enter. Safer version
Adding Note about Many people suggest using |
|||||||||
|
|
There are lots of ways to delete a directory through CLI mode. It depends on which way you are comfortable with.
If you are new in Linux, use the man pages of commands ( |
||||
|
|
|
I was having some trouble with that today, but I overcame it with sudo. Caveat: Be very certain you want to delete the entire thing before using the command below.
I successfully did this today, and removed many non-empty directories that I confirmed I didn't want/need. I'm using 14.04 LTS |
|||||
|
|
By the way I personally wanted to delete a directory containing a write protected file/s (.git and sub directories) and eventually realised I also needed to become a super user in order to successfully delete these files. Here is what I did:
|
|||||||||||||
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
rm -r lamppwill do. – John Strood Jul 1 '16 at 19:39