FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-14-2012, 10:19 AM
CJ Tres
 
Default exec command

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?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Sat Jan 14 13:30:01 2012
Return-path: <devel-bounces@lists.fedoraproject.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Sat, 14 Jan 2012 13:21:42 +0200
Received: from bastion01.fedoraproject.org ([209.132.181.2]:35313 helo=bastion.fedoraproject.org)
by s2.java-tips.org with esmtp (Exim 4.69)
(envelope-from <devel-bounces@lists.fedoraproject.org>)
id 1Rm1g6-0001qM-Mt
for tom@linux-archive.org; Sat, 14 Jan 2012 13:21:42 +0200
Received: from lists.fedoraproject.org (collab03.vpn.fedoraproject.org [192.168.1.70])
by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id 414DE21568;
Sat, 14 Jan 2012 11:21:45 +0000 (UTC)
Received: from collab03.fedoraproject.org (localhost [127.0.0.1])
by lists.fedoraproject.org (Postfix) with ESMTP id 7DCED415C5;
Sat, 14 Jan 2012 11:21:44 +0000 (UTC)
X-Original-To: devel@lists.fedoraproject.org
Delivered-To: devel@lists.fedoraproject.org
Received: from smtp-mm01.fedoraproject.org (smtp-mm01.fedoraproject.org
[80.239.156.217])
by lists.fedoraproject.org (Postfix) with ESMTP id 30FDA4153B
for <devel@lists.fedoraproject.org>;
Sat, 14 Jan 2012 11:21:27 +0000 (UTC)
Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com
[209.85.212.173])
by smtp-mm01.fedoraproject.org (Postfix) with ESMTP id 9D89FC0818
for <devel@lists.fedoraproject.org>;
Sat, 14 Jan 2012 11:21:25 +0000 (UTC)
Received: by wibhm11 with SMTP id hm11so1240559wib.32
for <devel@lists.fedoraproject.org>;
Sat, 14 Jan 2012 03:21:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:content-transfer-encoding;
bh=70VcyaZEujfm2pw1vGeJrsVEtlP7GUKecpshSO3vMQ4=;
b=oXr4/ZFkOvagKhdej6wZfCGK3AdDRISLCR6wLgkJmiT0KmT0MffyPTH y92aO0at0Ga
1duNKJhSU+OXxLoP9B7VXhWcc1bdbsO75N/3CH9YgCD5WknAt6J3Ns3BT3mnFhUHR15X
FMkO8gx/B07DfFuNIGr2c7q0GjA9JA1ECtlWg=
Received: by 10.180.83.72 with SMTP id o8mr2539448wiy.22.1326540084553;
Sat, 14 Jan 2012 03:21:24 -0800 (PST)
Received: from localhost.localdomain (85-220-55-128.dsl.dynamic.simnet.is.
[85.220.55.128])
by mx.google.com with ESMTPS id fc6sm10084645wbb.16.2012.01.14.03.21.22
(version=SSLv3 cipher=OTHER); Sat, 14 Jan 2012 03:21:23 -0800 (PST)
Message-ID: <4F1164FD.401@gmail.com>
Date: Sat, 14 Jan 2012 11:20:29 +0000
From: =?UTF-8?B?IkrDs2hhbm4gQi4gR3XDsG11bmRzc29uIg==?=
<johannbg@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
rv:9.0) Gecko/20111222 Thunderbird/9.0
MIME-Version: 1.0
To: devel@lists.fedoraproject.org
Subject: Re: [ACTION REQUIRED] Retiring packages for F-17
References: <20120113161113.GA6202@nostromo.devel.redhat.com >
<jeq2lu$8iu$1@dough.gmane.org> <20120113225100.4cb65249@gmail.com>
<4F11596E.8040509@gmail.com>
<CAEUgiHcK9bU-COMD27d3zu29ip=2t=oBRxEwYLCGv2j7FYT-6w@mail.gmail.com>
In-Reply-To: <CAEUgiHcK9bU-COMD27d3zu29ip=2t=oBRxEwYLCGv2j7FYT-6w@mail.gmail.com>
X-BeenThere: devel@lists.fedoraproject.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: Development discussions related to Fedora
<devel@lists.fedoraproject.org>
List-Id: Development discussions related to Fedora
<devel.lists.fedoraproject.org>
List-Unsubscribe: <https://admin.fedoraproject.org/mailman/options/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=unsubscrib e>
List-Archive: <http://lists.fedoraproject.org/pipermail/devel/>
List-Post: <mailto:devel@lists.fedoraproject.org>
List-Help: <mailto:devel-request@lists.fedoraproject.org?subject=help>
List-Subscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: devel-bounces@lists.fedoraproject.org
Errors-To: devel-bounces@lists.fedoraproject.org

T24gMDEvMTQvMjAxMiAxMDo0NCBBTSwgSWFpbiBBcm5lbGwgd3 JvdGU6Cj4gWW91J3ZlIGdvdCB0
byBiZSBraWRkaW5nLiBJbiBhIGxpdHRsZSBvdmVyIHRocmVlIH llYXJzLCBJJ3ZlIHBpY2tlZCB1
cAo+IG1vcmUgdGhhbiAzMDAgcGFja2FnZXMgYW5kIG9ubHkgOD EgYnVncyAtIG1vc3Qgb2Ygd2hp
Y2ggYXJlIGZyb20KPiB1cHN0cmVhbSByZWxlYXNlIG1vbml0b3 JpbmcuIEkndmUgZ290IG5vIHBy
b2JsZW0gYXQgYWxsIGtlZXBpbmcgdXAKPiB3aXRoIHRoZSB3b3 JrLgoKTm9wZSBubyBraWRkaW5n
IHdpdGggbXkgZXhhbXBsZSBhYm92ZSBhbmQgdG8gcG9pbnQgeW 91IG91dCBvdGhl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6aWxsaW9uIHBhY2 thZ2VzIGFuZCBpdCB3b3VsZCBu
b3QgdGFrZSBtb3JlIHRoZW4gCmEgYnVzIGFjY2lkZW50IHRvIG xlYXZlIHRoZSBwcm9qZWN0IGlu
IGxpbWJvLi4uCgpJIHdvdWxkIHRoaW5rIHRoZSBwcm9qZWN0cy Bnb2FsIGhlcmUgaXMgdG8gaGF2
ZSBtb3JlIGluZGl2aWR1YWxzIAptYWludGFpbmluZyB0aGUgc2 FtZSBwYWNrYWdlIG5vdCBvbmUg
bWFpbnRhaW5lciBtYWludGFpbmluZyBhbGwgdGhlIApwYWNrYW dlcwoKSG93IG1hbnkgY28tbWFp
bnRhaW5lcnMgZG8geW91IGhhdmUgb24gdGhvc2UgMzAwIHBhY2 thZ2VzIHlvdSBtYWludGFpbiAK
YW5kIGhvdyBtdWNoIHRpbWUgb24gYXZlcmFnZSBkaWQgeW91IH NwZW5kIG9uIGZpeGluZyBvbmUg
b2YgdGhvc2UgODEgCmJ1Z3MgKCBmcm9tIHJlcG9ydCB0byBidW lsZCB3aXRoIGZpeCApCgpKQkcK
LS0gCmRldmVsIG1haWxpbmcgbGlzdApkZXZlbEBsaXN0cy5mZW RvcmFwcm9qZWN0Lm9yZwpodHRw
czovL2FkbWluLmZlZG9yYXByb2plY3Qub3JnL21haWxtYW4vbG lzdGluZm8vZGV2ZWw=
 
Old 01-14-2012, 10:30 AM
Colin Law
 
Default exec command

On 14 January 2012 11:19, CJ Tres <ctres@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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-14-2012, 10:42 AM
PleegWat
 
Default exec command

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/14/2012 12:19 PM, CJ Tres 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?
>

You need to terminate the argument to -exec with a ;, which needs to
be quoted or escaped for the shell, and you need to include an
argument of {} which will be replaced by the name of the file find has
found. You also seem to have confused the argument order to find.

find $path -type f -iname '*.html' -exec rm -rf {} ;

Here you should fill your path for $path.
Specifically when deleting files, you may also use the find action
- -delete, which has the same effect as -exec rm:

find $path -type f -iname '*.html' -delete

This version should be faster when a lot of files need to be deleted.

PleegWat
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPEWoFAAoJEAM6sLJjDJaMpi4H/A7IC4uecdoerhWwmq6FZ0VX
zlrea0qLzYLmxpbD6m7UACotHjBag9i3JK4hoYzzNgfBFNX02l Aq5T6uusqQvlBU
hpKhZ/yyLNKgflM2Q+NGrRCpmSXffLQ2Cw91Yv+SfV3Rr3X+wWU01G1P A1VRJnrf
J+frtMjT24OQLYt8nfvlsH4NVz44T6KUJUnf9iepAT74bAPiWy nGocA2YtYK+yfL
qPFpcvgvlkeyC6a783Py6p5dFTg3bT3WlLyKVqQ7grq9ov6zcr Ng2IuQpJs3Zw2F
KMMSl2R4bzGOF5HDnF6AMGZGRyUNEZTBds8VboXHLIBvMdQFbV 7evWsOYRz2fXs=
=MwuR
-----END PGP SIGNATURE-----

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 06:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org