Answer the question
In order to leave comments, you need to log in
How to delete folders along with files in shell script?
You need to delete all the contents inside the folder, the folder itself should remain untouched. There is a script:
It deletes all files in the Swap folder, but empty folders remain. Help to correct the script so that not only files but also folders inside are deleted. find /volume1/Swap/ -mtime +0 -exec rm {} \;
Answer the question
In order to leave comments, you need to log in
Help to correct the script so that not only files but also folders inside are deleted.
find /volume1/Swap/ -depth -mindepth 1 -mtime +0 -delete
this is the most famous command in Linux,
even having its own page on lurk and on the wiki
wikireality.ru/wiki/Rm_-rf
lurkmore.to/Rm_-rf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question