0

In terminal if I type

mdfind -onlyin ~/"Desktop/Shows I Watch" "Bob"

I get the output

/Users/brendans/Desktop/Shows I Watch/Bob's Burgers

As I would expect. But if I try

mdfind -onlyin ~/"Desktop/Shows I Watch" "Bob's Burgers"

I get nothing. I've tried lots of different escape keys for the apostrophe, but they all return nothing.

Here's a list of everything I've tried:

mdfind -onlyin ~/"Desktop/Shows I Watch" "Bob\'s Burgers"
mdfind -onlyin ~/"Desktop/Shows I Watch" "Bob\''s Burgers"
mdfind -onlyin ~/"Desktop/Shows I Watch" "Bob''s Burgers"
mdfind -onlyin ~/"Desktop/Shows I Watch" "Bob\\'s Burgers"
mdfind -onlyin ~/"Desktop/Shows I Watch" "'Bob'\\''s Burgers'"

What am I missing here?!?

1

You need to escape the single apostrophe with a single backslash and do not quote the show name if it has an apostrophe, just escape any spaces with a single backslash too, as in the examples below:

$ mdfind -onlyin ~/Desktop/"Shows I Watch" Bob\'s\ Burgers
/Users/name/Desktop/Shows I Watch/Bob's Burgers
$ mdfind -onlyin ~/Desktop/Shows\ I\ Watch Bob\'s\ Burgers
/Users/name/Desktop/Shows I Watch/Bob's Burgers
$ 

It should actually work with the show name in quotes as in the first example you have under "Here's a list of everything I've tried:", it worked on my system.

$ mdfind -onlyin ~/"Desktop/Shows I Watch" "Bob\'s Burgers"
/Users/name/Desktop/Shows I Watch/Bob's Burgers
$ 
  • Thank you so much. mdfind -onlyin ~/Desktop/"Shows I Watch" Bob\'s\ Burgers works as expected. – DrunkTankGunner Oct 1 '16 at 0:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .