[X-Unix] question about 'find'

Charles Howse chowse at charter.net
Sat Nov 26 20:25:31 PST 2005


> On Sat, Nov 26, 2005 at 09:24:35PM -0600, Charles Howse wrote:
>> $ find ~/bin -name \*.sh -maxdepth 1 -perm 0644 -exec chmod 744 {} \;
>> 
>> This works as expected (I found the '\;' part on a web site), but I'm not
>> sure why I have to use the '\' as the next-to-last character.
>> Can't find anything about it in 'man find'.
>> Can anyone enlighten me?
>> If I missed it in 'man find', please point me to the correct section.  :-)
> 
> The semicolon is the delimiter for the end of the command being run
> by "-exec", the backslash is necessary to quote it and keep it
> from being interpreted as by the shell running "find".
> 
> This is such a "well-known" fact that the man page neglects to
> mention it :-(
> 
> The "find" command is an especially complex and quirky command
> with differences across various Unix/Linux versions.

It is, isn't it?
I just searched through 'man find' again, looking for 'backslash', and the
only references to it were for escaping pattern matching characters, i.e.
"[", "]", "?", "*", etc.

They always told me, "You don't know 'till someone tells you." (if it's not
in the man page)  :-) 



More information about the X-Unix mailing list