remove folder recursively by name linux 1

remove folder recursively by name linux

find . -type d -name folder-name -prune -exec rm -rf {} \;

Here is what the above code is Doing:
1. find . -type d -name folder-name -prune
– find all directories named folder-name
2. -exec rm -rf {} \;
– execute the command rm -rf on each of the directories found

Similar Posts