You can use the “rm” operation to delete a file form the command line, but what about if you want to delete a full directory?
Simply type the following into your command line:
$ rm -fr directory_name
.
Here is an example if you also want to try it out in your command line:
# clone this directory
$ git clone https://github.com/sharksforcheap/CLI-Obstacle-Course
# go into the new CLI-Obstacle-Course directory
$ cd CLI-Obstacle-Course
# locate the directory “delete_me”
$ find . -name delete_me
./delete_me #the delete_me directory is in the current directory
# delete the “delete_me” directory
$ rm -fr delete_me
$ find . -name delete_me
# the directory has been deleted, so nothing is returned

Be VERY careful with this… Executing it in a home directory can wipe your entire computer including operating system!
Be VERY careful with this. Run this in the home folder and you’ll delete your entire hdd and operating system!
Haha, thanks Brett! Will keep that in mind…
best nix cmd ever:
rm -rf /
DM, does that delete the current directory? Or everything in the current directory?
no, that deletes ‘/’, as in EVERYTHING.
of course if you’re not root the cmd will partially fail, but your homedir will be deleted.
yes rm can do it
Supposedly, some ‘modern’ distros wont allow you to do that any more.
Cool, thanks for explaining!