-   Linux - Newbie (
-   -   Delete a subfolder ABC from main Project Folder (

adarshmca 07-29-2011 12:22 AM

Delete a subfolder ABC from main Project Folder
Dear all,

I want to delete a subfolder ABC in a main Project folder Globe.
It occurs in many subfolders.

It is very hectic to search and issue an rm -rf ABC command.

I need to make a script for that .

Can anyone tell me how to make this


chrism01 07-29-2011 01:09 AM

Start by reading up on 'find'

jv2112 07-30-2011 05:11 PM

find /path to parent/folder/ -type d -and -iname Folder-Name -exec stat {} \;

Validate they are the correct folders. Then change stat to rm -fr.

T3RM1NVT0R 07-30-2011 05:21 PM

@ Reply
Hi there,

You can also try the following commands:


find / -name name_of_the_folder -print
The above command will print the location where that folder ABC has been created

you can delete the folder with the same command but with little modification:


find / -name name_of_the_folder -print -delete
I hope this helps.

adarshmca 07-31-2011 11:52 PM


All times are GMT -5. The time now is 05:56 AM.