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
footer.png and a subdirectory.
Now I want to delete
footer.png and the subdirectory, but not
How can I do this in linux?