The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
command to find out total size of a specific file size (spread over the server) abhinov SUN Solaris 3 08-08-2007 07:48 AM
Size limitation in Tar command Manvar Khan Shell Programming and Scripting 4 07-20-2007 10:19 AM
File size limitation for rcp schoubal Linux 2 01-14-2006 01:58 AM
File size limitation of unix sort command. cskumar Shell Programming and Scripting 7 10-07-2005 11:37 AM
HP-UX 11i - File Size Limitation And Number Of Folders Limitation sundeep_mohanty HP-UX 2 08-01-2005 08:58 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-28-2009
Arunprasad Arunprasad is offline
Registered User
  
 

Join Date: Aug 2008
Location: syn chen
Posts: 73
Post Find command -size option limitation ?

Hi All,

I ran code in test environment to find the files more than 1TB given below is a snippet from code:

FILE_SYSTEM=/home/arun
MAX_FILE_LIMIT=1099511627776
find $FILE_SYSTEM -type f -size +"$MAX_FILE_LIMIT"c -ls -xdev 2>/dev/null |
while read fname
do
echo "File larger than or equal to 1TB:"
echo $fname | awk '{print $11}'
done


The above is not listing any of the files as there is no such big files exists in my test environment. So, it is working fine.

But the same code in my production environment, lists the files smaller than 1TB also, like 6 GB files also.... at this point there is no file for 1TB also - so it is not listed.

My Question is: why it has picked up files lesser than the given size?

One more doubt: Is there any limitation on mumber of digits of parameters been passed to size option on find command? As per above 13-digits are passed.

Please help me out on this with your expert thoughts.

Thanks.
  #2 (permalink)  
Old 06-28-2009
scottn scottn is online now Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,120
I don't know why there would be such a limit.

You could try


Code:
MAX_FILE_LIMIT=1024
find $FILE_SYSTEM -type f -size +"$MAX_FILE_LIMIT"G -ls -xdev 2>/dev/null

  #3 (permalink)  
Old 06-28-2009
Arunprasad Arunprasad is offline
Registered User
  
 

Join Date: Aug 2008
Location: syn chen
Posts: 73
Hi Scottn,

I was successful with:


Code:
MAX_FILE_LIMIT=1073741824
find $FILE_SYSTEM -type f -size +"$MAX_FILE_LIMIT"k -ls -xdev

Hopefully, the same with G option will also work.-but capital G also works? i havn't tried.

Can you clear me, why this code:
Code:
MAX_FILE_LIMIT=1099511627776
find $FILE_SYSTEM -type f -size +"$MAX_FILE_LIMIT"c -ls -xdev 2>/dev/null

listed the files which are lesser than the given size.

I suspect, there is some limitation and that was restricting this find command to process normally with the given size and so it started listing all files from smaller to greater..... - i dont know, whether 6 GB is the smallest file at that time, but it started picking from that size.

Any thoughts will be very helpful for me!

Thanks.
  #4 (permalink)  
Old 06-28-2009
scottn scottn is online now Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,120
I don't have 1TB to play about with, so I can't test it!

G does work (don't know why it's uppercase when b, c and k are lowercase).

+SIZE means larger than. To find files smaller you would use -SIZE (in fact you can use both at the same time).

Perhaps it's a 32-bit issue (max 4GB) so it can't handle the 1099511627776? (just a dodgy guess at best)
Reply

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 On




All times are GMT -4. The time now is 09:03 AM.


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-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0