i see "{}" in various commands around here what is there funtion?


find / -type f -exec grep email@host {} /dev/null \;
find /home/domains/*/ -type d -exec chmod 777 {} \;

is the {} \; part of the -type funciton?

this is what i understand about the following commands.

1) start the find at the root dir.
a) only looking for flatfiles
b) grep for email@host in any matches from the find
?c?) the output for the find fills the namespace {}?
d) /dev/null is used to so the output of the whole command lists filename then search pattern
e) \; why the backslash the line is not continueing and why they semi-colon.

c) correct: the {} gets replaced with each filename that 'find' finds. (!)

e) 'find' commands always have to be terminated with a semi-colon. Since most (all?) shells interpret that as a special character, it has to be escaped with a slash.


i didnt know that it always has to end in a semi-colon.

on sol 6 and 7 using ksh shell i always just type

find . -name search-pattern -print

You are right. I meant to say that when you use the "-exec" option it has to end in a semi-colon.

thanks for the explination.