Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
Yes. In order to erase all files, the command rn is frequently used. In order to erase all files in the current directory, including all its sub-directories, the command “rm –r *” is used. The * indicates to the system that all entries must be deleted.
In order to delete all files in the directory donotdelete, one would use
rm -r donotdelete /*
However, this will not delete any hidden file if they exist.