Bonjour,
J'ai un repertoire qui contient des fichiers en tout genre.
Je veux n'en garder que les fichiers PHP, HTML et CSS.
La recherche sera basée sur l'extension du fichier.
Ce que j'ai voulu faire c'est chercher tous les fichiers dont le nom ne
contient ni html, ni htm, ni php, ni css et les supprimer.
Mon problème c'est que je ne sais pas comment faire de négation dans la
recherche de fichiers. Une fois la négation faisable, je saurais faire,
avec -exec la suppression qu'il faut.
J'ai parcouru rapidement le man et quelques documents sur internet, mais
je n'arive à rien meme apres quelques tentatives de tatonnement...
Auriez-vous une piste?
Voici ma version de find:
mihamina@localhost:~/ja_genista$ find --version
GNU find version 4.2.31
Built using GNU gnulib version 2007-02-24
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION
--
Huile Essentielle de Camphre http://www.huile-camphre.fr
Infogerance http://www.infogerance.us
(Serveurs, Postes de travail, Développement logiciel)
J'arrive sur le tard ... Mais j'ai une petite question : Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans cette commande. Dans quel cas faut-il les utiliser ?
Merci :)
-- Nicolas - MICHEL at bluewin point ch AIM : michelnicolas
J'arrive sur le tard ...
Mais j'ai une petite question :
Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans cette
commande. Dans quel cas faut-il les utiliser ?
Merci :)
--
Nicolas - MICHEL at bluewin point ch
AIM : michelnicolas
J'arrive sur le tard ... Mais j'ai une petite question : Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans cette commande. Dans quel cas faut-il les utiliser ?
Merci :)
-- Nicolas - MICHEL at bluewin point ch AIM : michelnicolas
talon
Nicolas MICHEL <Nicolas-MICHEL'_remove_'@bluewin.ch> wrote:
J'arrive sur le tard ... Mais j'ai une petite question : Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans cette commande. Dans quel cas faut-il les utiliser ?
Merci :)
expression -and expression expression expression The -and operator is the logical AND operator. As it is implied by the juxtaposition of two expressions it does not have to be specified.
--
Michel TALON
Nicolas MICHEL <Nicolas-MICHEL'_remove_'@bluewin.ch> wrote:
J'arrive sur le tard ...
Mais j'ai une petite question :
Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans cette
commande. Dans quel cas faut-il les utiliser ?
Merci :)
expression -and expression
expression expression
The -and operator is the logical AND operator. As it is implied
by the juxtaposition of two expressions it does not have to be
specified.
J'arrive sur le tard ... Mais j'ai une petite question : Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans cette commande. Dans quel cas faut-il les utiliser ?
Merci :)
expression -and expression expression expression The -and operator is the logical AND operator. As it is implied by the juxtaposition of two expressions it does not have to be specified.
--
Michel TALON
Nicolas-MICHEL'_remove_'
Michel Talon wrote:
expression -and expression expression expression The -and operator is the logical AND operator. As it is implied by the juxtaposition of two expressions it does not have to be specified.
Ah, bin oui, que je suis con. En plus j'ai resortit le man avant de poster, par rélexe, mais ne l'ai pas vraiment lu, comme d'hab. <:o)
Merci :) -- Nicolas - MICHEL at bluewin point ch AIM : michelnicolas
Michel Talon <talon@lpthe.jussieu.fr> wrote:
expression -and expression
expression expression
The -and operator is the logical AND operator. As it is implied
by the juxtaposition of two expressions it does not have to be
specified.
Ah, bin oui, que je suis con.
En plus j'ai resortit le man avant de poster, par rélexe,
mais ne l'ai pas vraiment lu, comme d'hab. <:o)
Merci :)
--
Nicolas - MICHEL at bluewin point ch
AIM : michelnicolas
expression -and expression expression expression The -and operator is the logical AND operator. As it is implied by the juxtaposition of two expressions it does not have to be specified.
Ah, bin oui, que je suis con. En plus j'ai resortit le man avant de poster, par rélexe, mais ne l'ai pas vraiment lu, comme d'hab. <:o)
Merci :) -- Nicolas - MICHEL at bluewin point ch AIM : michelnicolas
Cyrille Lefevre
Nicolas MICHEL <Nicolas-MICHEL'_remove_'@bluewin.ch> wrote:
Stephane Chazelas wrote:
find . ! -name '*.htm' ! -name '*.html' ... -exec rm -f {} + J'arrive sur le tard ...
Mais j'ai une petite question : Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans c ette commande. Dans quel cas faut-il les utiliser ?
Merci :)
expression -and expression expression expression The -and operator is the logical AND operator. As it is i mplied by the juxtaposition of two expressions it does not have t o be specified.
Hi, Bonjour,
-and n'est pas portable, la syntaxe d'origine est -a.
expression [-a] expression Conjunction of primaries; the AND operator is implied by the juxtaposition of two primaries or made explicit by the optional -a operator. The second expression shall not be evaluated if the first expression is false.
à ce propos, notez le [-a], qui est implicite...
Regards, Cordialement,
Cyrille Lefevre. -- mailto:Cyrille.Lefevre-news% supprimer "%nospam% et ".invalid" pour me repondre. remove "%nospam" and ".invalid" to answer me.
Nicolas MICHEL <Nicolas-MICHEL'_remove_'@bluewin.ch> wrote:
find . ! -name '*.htm' ! -name '*.html' ... -exec rm -f {} +
J'arrive sur le tard ...
Mais j'ai une petite question :
Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans c ette
commande. Dans quel cas faut-il les utiliser ?
Merci :)
expression -and expression
expression expression
The -and operator is the logical AND operator. As it is i mplied
by the juxtaposition of two expressions it does not have t o be
specified.
Hi, Bonjour,
-and n'est pas portable, la syntaxe d'origine est -a.
expression [-a] expression
Conjunction of primaries; the AND operator is implied by the
juxtaposition of two primaries or made explicit by the optional -a
operator. The second expression shall not be evaluated if the first
expression is false.
à ce propos, notez le [-a], qui est implicite...
Regards, Cordialement,
Cyrille Lefevre.
--
mailto:Cyrille.Lefevre-news%nospam@laposte.net.invalid
supprimer "%nospam% et ".invalid" pour me repondre.
remove "%nospam" and ".invalid" to answer me.
Nicolas MICHEL <Nicolas-MICHEL'_remove_'@bluewin.ch> wrote:
Stephane Chazelas wrote:
find . ! -name '*.htm' ! -name '*.html' ... -exec rm -f {} + J'arrive sur le tard ...
Mais j'ai une petite question : Je suis surpris qu'il n'y ait pas d'opérateur "-and" ou "-or" dans c ette commande. Dans quel cas faut-il les utiliser ?
Merci :)
expression -and expression expression expression The -and operator is the logical AND operator. As it is i mplied by the juxtaposition of two expressions it does not have t o be specified.
Hi, Bonjour,
-and n'est pas portable, la syntaxe d'origine est -a.
expression [-a] expression Conjunction of primaries; the AND operator is implied by the juxtaposition of two primaries or made explicit by the optional -a operator. The second expression shall not be evaluated if the first expression is false.
à ce propos, notez le [-a], qui est implicite...
Regards, Cordialement,
Cyrille Lefevre. -- mailto:Cyrille.Lefevre-news% supprimer "%nospam% et ".invalid" pour me repondre. remove "%nospam" and ".invalid" to answer me.