need some help using the find command with Solaris
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > need some help using the find command with Solaris




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    need some help using the find command with Solaris  
walterbyrd


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-07 06: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.






[ Post a follow-up to this message ]



    Re: need some help using the find command with Solaris  
greg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-07 06: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





[ Post a follow-up to this message ]



    Re: need some help using the find command with Solaris  
Horst Scheuermann


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-17-07 12:32 PM

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 keinesfall
s
zur Seite.





[ Post a follow-up to this message ]



    Re: need some help using the find command with Solaris  
walterbyrd


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-07 06: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.






[ Post a follow-up to this message ]



    Re: need some help using the find command with Solaris  
greg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-07 06: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  ----





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:58 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register