exec command

CJ Tres ctres at grics.net
Sat Jan 14 13:06:01 UTC 2012

On 01/14/2012 05:30 AM, Colin Law wrote:
> On 14 January 2012 11:19, 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?
> man find shows an example similar to your requirement
> find . -type f -exec file '{}' \;
> which suggests that you have got some bits missing from the exec spec.
> Colin

Thanks Colin, this helps.

Don't know if it's true but years ago I read somewhere that man pages 
are written by developers for developers.
I started reading man find, trying to locate what was relevant to my 
application and was quickly overwhelmed - never-mind 1500 + lines.

Makes me feel deficient when I see "read the man page" everywhere as if 
it should make everything clear and I often end up more confused after 
reading them.
Maybe if I dug into shell scripting it would help.

I feel as if I was trying to understand all aspects of how an automatic 
transmission operates so I can drive a car... still I continue to slog 
through them when I have the time.

More information about the ubuntu-users mailing list