Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

find file size greater than 1 GB

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-08-2009
ali560045's Unix or Linux Image
ali560045 ali560045 is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 28 August 2012, 1:26 AM EDT
Posts: 333
Thanks: 2
Thanked 0 Times in 0 Posts
find file size greater than 1 GB

i have a command that finds the file whoese filesize is more than 1 GB. below the command

Code:
find /ednpdtu3/u01/pipe -type f -size +1048576

the above command only display the filename , how can i get the displayed file's filesize ?

Thanks in advance
Sponsored Links
    #2  
Old Unix and Linux 01-08-2009
lorcan lorcan is offline
Registered User
 
Join Date: May 2007
Last Activity: 13 August 2012, 12:14 AM EDT
Posts: 224
Thanks: 0
Thanked 2 Times in 2 Posts
Make use of printf in the find command


Code:
find /ednpdtu3/u01/pipe -type f -size +1048576 -printf "%s:%h%f\n"

You can use %s/%k

Last edited by lorcan; 01-08-2009 at 12:57 AM..
Sponsored Links
    #3  
Old Unix and Linux 01-08-2009
ali560045's Unix or Linux Image
ali560045 ali560045 is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 28 August 2012, 1:26 AM EDT
Posts: 333
Thanks: 2
Thanked 0 Times in 0 Posts
i used the above command but it showing below error

find: bad option -printf
    #4  
Old Unix and Linux 01-08-2009
lorcan lorcan is offline
Registered User
 
Join Date: May 2007
Last Activity: 13 August 2012, 12:14 AM EDT
Posts: 224
Thanks: 0
Thanked 2 Times in 2 Posts
Are you working on SunOS?
Sponsored Links
    #5  
Old Unix and Linux 01-08-2009
ali560045's Unix or Linux Image
ali560045 ali560045 is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 28 August 2012, 1:26 AM EDT
Posts: 333
Thanks: 2
Thanked 0 Times in 0 Posts
NO. me working in IBM AIX 5.3.
Can u help me in getting that command right i think some other option we need to use with printf in AIX
Sponsored Links
    #6  
Old Unix and Linux 01-08-2009
ali560045's Unix or Linux Image
ali560045 ali560045 is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 28 August 2012, 1:26 AM EDT
Posts: 333
Thanks: 2
Thanked 0 Times in 0 Posts
got the solution by using xargs but it is showing files which are even less than 1GB in Size.

below the command:

Code:
find /ednpdtu3/u01/pipe -type f -size +1048576 | xargs du -sg

Sponsored Links
    #7  
Old Unix and Linux 01-08-2009
cromohawk cromohawk is offline
Registered User
 
Join Date: Jun 2008
Last Activity: 17 April 2010, 1:37 AM EDT
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
# find /yourfilesystem -xdev -size +1000000 -exec ls -lh {} \; | sort +4n | more

play around with the +1000...depends on what amount u wanna find..

best of luck !
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 Solaris 3 08-08-2007 06:48 AM
Find lines greater than 80 characters in a file mrgubbala Shell Programming and Scripting 8 03-10-2007 11:51 PM
Can I find wether a particular file exist and size greater than zero...help please guhas Shell Programming and Scripting 4 11-28-2005 12:56 PM
File size greater than 0 skammer1234 Shell Programming and Scripting 1 08-03-2002 10:30 AM
file exists and size greater that zero methos Shell Programming and Scripting 3 03-25-2002 12:44 PM



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