Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filesize

Status
Not open for further replies.

orbiton

Technical User
Jan 12, 2005
30
US
Hi
I will like to find files that are above 1000mb on my system then append the file names into a folder for later vewing.

Is it possible to get a script for this job?

Thank you,
 
Hi. No particular need for a script as such. Something like:

find / -size +2048 > bigfiles.txt

should give you files over 1Gb in size in bigfiles.txt.

I want to be good, is that not enough?
 
Thank you, how about if i want to know sizes from 50mb upwards or 100mb
 
man find, paying particular attention to the -size option.
-size n[c]
True if the file is n blocks long (512 bytes per block). If n is followed by a c, the size is in bytes.

So really it's just a matter deciding what size you want to search for (a + sign indicates anything over the value).

I want to be good, is that not enough?
 
Thanks Ken

I need to have the file size and file name in the bigfiles.txt, at the moment am only getting the file names when I do find / -size +50 > bigfiles.txt..

When I try find / -size +50 | ls -als|awk '{print $9,$5)' > bigfiles.txt it's not working
 
Perhaps:

find / -size +50 -exec ls -la {} \; | tr -s ' ' ' ' | cut -f9,5 -d' ' > bigfiles.txt

I want to be good, is that not enough?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top