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

Comments

Popular posts from this blog

PHP - How to increase size of POST value in php

D8 KernelEvents constants

D8 - Attach file programmatically to a node