• [^] # Re: Sans expression régulière...

    Posté par . En réponse au message find..... Évalué à 7.

    Les "vrais geeks" lisent les manpages.
    Et donc si tu avais agit en vrai geek tu aurais constaté l'existence de ce court paragraphe:

    -regex pattern
    File name matches regular expression pattern. This is a match
    on the whole path, not a search. For example, to match a file
    named `./fubar3', you can use the regular expression `.*bar.' or
    `.*b.*3', but not `b.*r3'.


    Et donc tu aurais pu écrire quelque chose dans ce gout là:

    [gco@gc]:/tmp/pwet% touch a.{plop,plip,plap}
    [gco@gc]:/tmp/pwet% cd ..
    [gco@gc]:/tmp% find -regex ".*\.pl[ao]p"
    ./pwet/a.plap
    ./pwet/a.plop
    [gco@gc]:/tmp%