R Ryan2309 New Member Joined Nov 12, 2019 Messages 5 Reaction score 1 Credits 45 Oct 21, 2020 #1 Hello , is there a way to delete all the directories within a folder without deleting all the files?
f33dm3bits Gold Member Gold Supporter Joined Dec 11, 2019 Messages 6,864 Reaction score 5,279 Credits 50,344 Oct 21, 2020 #2 Ryan2309 said: Hello , is there a way to delete all the directories within a folder without deleting all the files? Click to expand... I think you also want to delete all the files of those directories you want to delete?
Ryan2309 said: Hello , is there a way to delete all the directories within a folder without deleting all the files? Click to expand... I think you also want to delete all the files of those directories you want to delete?
OP R Ryan2309 New Member Joined Nov 12, 2019 Messages 5 Reaction score 1 Credits 45 Oct 21, 2020 #3 i do.
f33dm3bits Gold Member Gold Supporter Joined Dec 11, 2019 Messages 6,864 Reaction score 5,279 Credits 50,344 Oct 21, 2020 #4 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.
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.