Saturday, 14 September 2013

OSX find specific path/combination and delete

OSX find specific path/combination and delete

I'm using OSX and would like to use the Unix 'find' command to find any
instances of the following and then delete it.
/Library/Application Support/Adobe/Acrobat/10.0
However, sometimes it's prefixed:
/Volumes/home/Library/Application Support/Adobe/Acrobat/10.0
Othertimes:
/Volumes/Backups/_rsync-date/Library/Application Support/Adobe/Acrobat/10.0
and so on...there are many other examples at various levels of the file
system.
So I want to be able to find on any directory where the combination of
"/Library/Application Support/Adobe/Acrobat/10.0" exists and delete it.
Yes, I can use the following to delete any directory named "10.0"
find . -type d -name "10.0" -exec rm -rf {} \;
But I'd like this search to be more specific so I'm not deleting any
folder with that name, but only folders prefixed "/Library/Application
Support/Adobe/Acrobat/10.0"
Your suggestions most appreciated!
Dan

No comments:

Post a Comment