Linux - How to delete all files recursively for sub-folders with out deleting the folder/sub-folder
To List all the files recursively form the patent folder and sub-folder,
cd /target/directory
find . -type f
To Delete all the files recursively form the patent folder and sub-folder,
cd /target/directory
find . -type f -delete
To Delete all the sub-folders & files recursively form the patent folder,
cd /target/directory
find . -type rf -delete
cd /target/directory
find . -type f
To Delete all the files recursively form the patent folder and sub-folder,
cd /target/directory
find . -type f -delete
To Delete all the sub-folders & files recursively form the patent folder,
cd /target/directory
find . -type rf -delete
Comments