Unix administration - need some help using the find command with Solaris

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > October 2007 > need some help using the find command with Solaris





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author need some help using the find command with Solaris
walterbyrd

2007-10-16, 1:28 pm

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.

greg

2007-10-16, 1:28 pm

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
Horst Scheuermann

2007-10-17, 7:32 am

greg <gmatt@nerc.ac.uk> 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.
walterbyrd

2007-10-19, 1:32 pm

On Oct 16, 8:51 am, greg <gm...@nerc.ac.uk> 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.

greg

2007-10-19, 1:32 pm

Horst Scheuermann wrote:
> greg <gmatt@nerc.ac.uk> writes:
>
> 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 ----
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com