1

I would like to be able to use the terminal command find to search for files, (easy enough) but then I want the containing folders to be automatically opened. Is there a way to do this in one line of script?

This is the argument that I have written but it still tries to open the file rather that simply the containing folder.

find ~/ -iname "*unbroken*" -execdir open {} ";"

2 Answers 2

6
find ~/ -iname "*unbroken*" -exec open -R {} ";"

The -R option to open tells it to reveal the file in the Finder. Not only will that open the containing folder, it will select the item.

0
1

Just try

find . -iname "*unbroken*" -execdir open . ";"

or (not tested)

find ~/ -iname "*unbroken*" -execdir open ~/ ";"
1
  • @brad thank u for accepting my answer, but i think Ken's answer is more correct than mine. :)
    – Kjuly
    May 3, 2015 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.