need some help using the find command with Solaris - Unix

This is a discussion on need some help using the find command with Solaris - Unix ; I want to delete all of the core files, unless those files are executable. I do not want to delete any core directories. I want this to run as fast as possible. I am especially having trouble understanding the way ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: need some help using the find command with Solaris

  1. need some help using the find command with Solaris

    I want to delete all of the core files, unless those files are
    executable. I do not want to delete any core directories. I want this
    to run as fast as possible. I am especially having trouble
    understanding the way that solaris using permissions.

    I suppose, it's something like this:

    find . -mount -type f -perm ugo !=x -name core | xargs /bin/rm -f

    Any help apprediated. Thanks.


  2. Re: need some help using the find command with Solaris

    walterbyrd wrote:
    > I want to delete all of the core files, unless those files are
    > executable. I do not want to delete any core directories. I want this
    > to run as fast as possible. I am especially having trouble
    > understanding the way that solaris using permissions.
    >
    > I suppose, it's something like this:
    >
    > find . -mount -type f -perm ugo !=x -name core | xargs /bin/rm -f
    >
    > Any help apprediated. Thanks.
    >


    almost... try this:

    find . -mount -type f -name core ! -perm -ugo=x | xargs rm -f

    the extra "-" applies the permissions as a mask rather than as absolute
    values.

    G

  3. Re: need some help using the find command with Solaris

    greg writes:

    > find . -mount -type f -name core ! -perm -ugo=x | xargs rm -f

    find ... -exec rm {} + is a nice feature in Solaris (it does the
    same as xargs)
    --
    12. Gebot: Wenn Ihr eine Fahrradklingel hört, wechsele die, die links geht
    nach rechts, die die rechts geht nach links, aber nicht bis zum Straßenrand.
    Danach dreht Euch um, reißt Mund, Nase und Augen auf, tretet aber keinesfalls
    zur Seite.

  4. Re: need some help using the find command with Solaris

    On Oct 16, 8:51 am, greg wrote:
    >
    > almost... try this:
    >
    > find . -mount -type f -name core ! -perm -ugo=x | xargs rm -f
    >
    > the extra "-" applies the permissions as a mask rather than as absolute
    > values.


    But, wouldn't the "!" negate that? It's early for me, I'm probably
    missing something.


  5. Re: need some help using the find command with Solaris

    Horst Scheuermann wrote:
    > greg writes:
    >
    >> find . -mount -type f -name core ! -perm -ugo=x | xargs rm -f

    > find ... -exec rm {} + is a nice feature in Solaris (it does the
    > same as xargs)


    I was under the impression that "| xargs rm -f" would be quicker as it
    will batch the file removals.
    ------------ And now a word from our sponsor ---------------------
    For a secure high performance FTP using SSL/TLS encryption
    upgrade to SurgeFTP
    ---- See http://netwinsite.com/sponsor/sponsor_surgeftp.htm ----

+ Reply to Thread