Unfortunately zsh: how to delete contents in folder without deleting the folder? does not have any good answer.
I'm currently using rm -rf {.,}* and if that fails because there is no hidden file in the folder I do another rm -rf *. This is of course annoying, not least because I am prompted for confirmation twice (so just putting them in a row with ; wouldn't solve much.)
Is there a solution that
- works in the presence and absence of hidden files;
- does not delete the current folder, even temporarily;
- prompts only once?
It must work in the current folder. If it also works for a specified folder, that's nice to have but not a must.
