Dollar sign in mdfind shell command I'm a newbie in shell scripting. What's the difference between these two commands? What's the use of the dollar sign?

mdfind $'kMDItemFSName="*iValet\'s*"c'




mdfind 'kMDItemFSName="*iValet\'s*"c'
A dollar sign before a single-quoted string is just another type of string, but it allows C-like escape characters, like \n and \'. 

It was used in the command you mentioned because it contains an escape for the single quote—normal single quoted strings do not allow any escapes at all, including escapes of the '. Backslashes are interpreted literally. So by using $'…' it avoided escaping the double quotes, and allowed the string to have a ' in it. 

There is some more information on this type of string quoting here on the Bash Hackers Wiki.