Pregunta

I am using zsh and I want to delete contents of a folder without deleting the folder itself. What is the best way to go about this?

¿Fue útil?

Solución

rm -r myfolder/* will delete all files in that folder that do not begin with a dot.

Really the simplest solution is rm -rf myfolder && mkdir myfolder.

Otros consejos

You can just use rm -r path/to/dir/*.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top