[X-Unix] question about 'find'

Albert Lunde atlunde at panix.com
Sat Nov 26 19:56:22 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.

-- 
    Albert Lunde  albert-lunde at northwestern.edu
                  atlunde at panix.com  (new address for personal mail)
                  albert-lunde at nwu.edu (old address)


More information about the X-Unix mailing list