Loading....
For example – to find all files > 100 MB in size
find .  -size +200000 -exec ls -l {} \;
Please follow and like us:

Last Update: June 21, 2009  

June 21, 2009 128 Gavin Soorma
Total 0 Votes:
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Add A Knowledge Base Question !

You will receive an email when your question will be answered.

+ = Verify Human or Spambot ?

2 thoughts on “How to find files based on size in Unix

  1. vinay

    Hi,
    nice post

    what is the relation between 100 and +200000 ??

    If i have to do for 10mb what is the size number ?

    Thx

  2. Gavin Soorma

    Hi Vinay – it is based on the Unix block size – in this AIX machine (as in most other cases as well) it is 512 bytes

    so the command below will list all files > 10 KB using the +20 flag in the ‘size’ command

    testdb:/u01/oracle/scripts> find . -size +20 -exec ls -l {} \;
    -rw-r—– 1 oracle dba 57344 Sep 9 2004 ./20040910/exp_prospector_schema_gnu1a.exp
    -rw-r—– 1 oracle dba 10713771 Sep 10 2004 ./20040910/exp_prospector_schema_gnu1a_rowsY.exp.Z
    -rw-r—– 1 oracle dba 16826 Sep 20 2004 ./20040920/edify_userprofile_20040920.dmp.Z
    -rw-r—– 1 oracle dba 102400 Sep 24 2004 ./20040924/test.imp
    -rw-r—– 1 oracle dba 106496 Feb 2 2006 ./cr19625_20060202/edify_userprofile.dmp
    -rw-r—– 1 oracle dba 71016 Jul 8 2008 ./p5632264_10203_AIX64-5L.zip
    -rw-r–r– 1 oracle dba 283359 Aug 18 2008 ./tutorial.sql
    testdb:/u01/oracle/scripts>

    This command will list files > 10 MB

    testdb:/u01/oracle/scripts> find . -size +2000 -exec ls -l {} \;
    -rw-r—– 1 oracle dba 10713771 Sep 10 2004 ./20040910/exp_prospector_schema_gnu1a_rowsY.exp.Z

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*

Social media & sharing icons powered by UltimatelySocial
Back To Top

Add A Knowledge Base Question !

You will receive an email when your question will be answered.

+ = Verify Human or Spambot ?