[CLUE-Cert] Sys Admin Test

Lynn Danielson lynn.danielson at clue.denver.co.us
Fri Sep 21 17:00:14 MDT 2001


Michael James Robbert wrote:
> 
> ... Then the \; is just escaping the ; that is required after the command.
> 
> Sean LeBlanc wrote:
> > I took the test today, and squeaked by with an 80%. 

Congratulations, Sean!  How did the voucher work for you?

> > some syntax I'm not familiar with. One of the questions
> > dealt with a command like this:
> >
> > find / -name core -exec rm -f{}\;
> >
> > I think I understand the first part, although I've never
> > used the -exec flag with find. But the {}\; is what I
> > don't understand. I might have the syntax incorrect: it's
> > possible there was a space after rm -f and before the last

Yeah, I think a space is needed between -f and {}.  I believe 
you need to escape the final semicolon so that you can use
semicolons to pass multiple commands to find with the -exec 
argument.  Alternatively, you can quote the semicolon.

A variation which I tend to prefer to find's exec switch is 
to pipe find to xargs, e.g.,

find / -name core | xargs rm -f 

The xargs command is also supposed to be able to use the
{} symbols to indicate argument substitution, but I haven't
been able to get this feature to work.

Lynn



More information about the clue-cert mailing list