exec command
Ioannis Vranos
ioannis.vranos at gmail.com
Sat Jan 14 13:30:02 UTC 2012
On Sat, Jan 14, 2012 at 1:19 PM, CJ Tres <ctres at grics.net> wrote:
> I'm trying to use the find and execute commands to remove *.html files in
> various subdirectories within a single directory but the command returns
> "missing argument to `-exec'
>
> the command I've entered is:
> find -type f -exec rm -rf"
> followed by the path, followed by:
> -iname '*.html'
>
> Find alone has found all the files but I'm not understanding what is wrong
> with the syntax "-exec rm -rf"
>
> Can someone see an obvious error?
>From a book I have been reading:
Type this command to find all files in your present working directory
whose names
are core and then delete them (i.e., automatically run the rm command):
$ find . -name core -exec rm {} \;
TIP The syntax for the -exec option with the find command as used here can be
hard to remember sometimes, and so you can also use the xargs method
instead of the
exec option used in this example. Using xargs, the command would then be written
$ find . -name 'core' | xargs rm
I think the xargs method is easier.
--
Ioannis Vranos
http://cppsoftware.binhoster.com
More information about the ubuntu-users
mailing list