I'm sorry for asking such a basic question:
How do I delete everything in a directory, including hidden files and directories?
Right now, I use the following:
rm -rf *
rm -rf .*
|
The best answer is: Don't do that. Recursively remove the directory itself, then recreate it. It's more reliable and easier for other people to understand what you're trying to do. When you re-create the directory it may have a different owner, group and permissions. If those are important be careful. |
|||||
|
Each of the three pattern expands to itself if it matches nothing, but that's not a problem here since we want to match everything and Note that |
|||
|
|
|
Simple and straight forward:
Includes directories and hidden files. At least gnu-find knows |
||||
|
|
|
if you are in the directory:
otherwise:
|
|||
|
|
|
How about using
|
||||
|
|
Oh my Zsh
Again, this is for Zsh only. |
|||||
|
|
Try |
|||||||||||
|
rm -rf .* *. – user unknown Mar 21 '11 at 3:38