I am trying to remove all files and subdirectories in a directory. I used rm -r
to remove all files, but I want to remove all files and subdirectories, excluding the top directory itself.
For example, I have a top directory like images
. It contains the files header.png
, footer.png
and a subdirectory.
Now I want to delete header.png
, footer.png
and the subdirectory, but not images
.
How can I do this in linux?
rm -Rf
of all the files and directories in there.