Remove/Delete All files from Directory and Remove all Subdirectories From Linux

To remove everything in a directory use:
rm /path/to/directory/*

If you also want to remove all subdirectories and the directory itself, you can use rm -rf /path/to/directory. But always double-check your line before pressing return, rm -rf can cause lots of havock as well, e.g. if you accidentally insert a space after the first slash while having superuser permissions...

Leave a Comment

Your email address will not be published. Required fields are marked *