Go Back   The UNIX and Linux Forums > Operating Systems > Solaris
.
google site



Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-27-2008
Registered User
 

Join Date: Aug 2008
Posts: 4
Find command with exclusions

Hi All

I need to find the biggest files on our system BUT excluding some directories.

I.E Find / -size +10000 (excluding 'platform'|'db' ..etc) |sort -n > file

I tried grep -v but that can only do one expression at a time. Tried /usr/xpg4/bin/grep but cant use -v

Please help
Chris
Sponsored Links
  #2 (permalink)  
Old 08-27-2008
Registered User
 

Join Date: Aug 2008
Location: India-Chennai
Posts: 120
find / -size +10000c | egrep -v "platform|db" |sort -n
  #3 (permalink)  
Old 08-27-2008
Registered User
 

Join Date: Aug 2008
Posts: 4
GREAT !!! Thanks its working 100%
  #4 (permalink)  
Old 08-27-2008
Registered User
 

Join Date: Aug 2008
Posts: 4
Just a quick question whats the 'c' for ? +10000c
  #5 (permalink)  
Old 08-27-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
The "c" stands for bytes (I guess originally "characters" but with Unicode and what not, that is not any longer one-to-one with bytes ... the "b" suffix is already used for "blocks" though) but isn't strictly necessary. As you might imagine, the manual page has more information.

Another approach is to use find's own options to exclude certain directories. The syntax is somewhat tricky but if you have GNU find, there is a rich set of conditions you can use to identify particular directories for inclusion or exclusion. A common trick is to select the directories you want to exclude and use -prune on them. So for example


Code:
find / -path /platform -prune -o -path /db -prune -o -size +10000 -ls

  #6 (permalink)  
Old 08-27-2008
Registered User
 

Join Date: Aug 2008
Posts: 4
Thanks era !
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 01:37 PM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 09:12 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 07:47 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 06:38 PM
how to find a file in UNIX without find command? bluo Shell Programming and Scripting 3 09-25-2003 12:47 AM



All times are GMT -4. The time now is 01:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0