Shell – How to delete everything in a directory

rmshellwildcards

How do I delete everything in a directory, including hidden files and directories?

Right now, I use the following:

rm -rf *
rm -rf .*

Best Answer

Simple and straight forward:

find -delete 

Includes directories and hidden files. At least gnu-find knows -delete, your find may differ.