The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem in filtering the file adityam UNIX for Dummies Questions & Answers 0 11-22-2007 04:37 AM
Help, filtering some info. from a file under "()" varungupta UNIX for Advanced & Expert Users 10 09-11-2007 03:59 AM
command to find out total size of a specific file size (spread over the server) abhinov SUN Solaris 3 08-08-2007 03:48 AM
Filtering multiple entries in a file suman_jakkula Shell Programming and Scripting 2 08-22-2006 02:02 AM
Urgent: Filtering a File HItesh Shell Programming and Scripting 5 05-11-2006 01:16 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-17-2002
nir nir is offline
Registered User
 

Join Date: Jan 2002
Posts: 1
filtering by file size

Hi !

I wanted to know how can i filter files by "size range".
like : getting all the files that are bigger than 100 byte and smaller than 200 byte ?

I want to make it as a script...

I noticed the unix command : find . -size +100c
but i also want limit it's upper bounds.
so something like :
find . -size +100c -200c
or
find . -size +100c && -200c

doesn't work...
What can i do ?

i also tried to use the "size" command on a file , but it doesn't return one value (the size in bytes).

w8ing 4 your answers...
Forum Sponsor
  #2  
Old 01-17-2002
Jimbo
Guest
 

Posts: n/a
The -a allows you to specify multiple primaries:

find . -size +100c -a -size -200c -exec ls -ld {} \;

but on HP-UX, it works without the -a also:
  #3  
Old 01-17-2002
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,445
from the find man page ....

Quote:
expr1 -a expr2
Same as expr1 expr2.

expr1 -and expr2
Same as expr1 expr2.

expr1 -o expr2
Or; expr2 is not evaluated if expr1 is true.

expr1 -or expr2
Same as expr1 -o expr2.

expr1 , expr2
List; both expr1 and expr2 are always evaluated.
The value of expr1 is discarded; the value of the
list is the value of expr2.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0