Deleting all directories not files

Ryan2309

New Member
Joined
Nov 12, 2019
Messages
5
Reaction score
1
Credits
45
Hello , is there a way to delete all the directories within a folder without deleting all the files?
 


Hello , is there a way to delete all the directories within a folder without deleting all the files?
I think you also want to delete all the files of those directories you want to delete?
 
Change to the folder where you want to delete all those directories.
Code:
find . -type d | xargs rm -rf
This searches for all directories and then removes them recursively without asking for verification.
 

Staff online


Top