find and size flag


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find and size flag
# 1  
Old 02-13-2009
find and size flag

Hello everyone,
I would like to filter and search for files in my curr dir where the blocks used by those files are over a certain number (i.e. 30), when I try this command

find . -name "c*" -size +30 -exec ls -ls {} \;

I get a list of files, the first column is the block size, right?

368 -rw-rw-r-- 1 xxx staff 374426 Dec 02 13:26 ./test_in
20 -rw-rw-r-- 1 xxx staff 19554 Dec 01 10:49 ./testout

Why is a file using 20 blocks getting listed there?
I hope you can shed some light on this.
Thanks.
# 2  
Old 02-13-2009
find uses a block size of 512.

From manual:

-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.

apparantly, ls -s uses a block size of 1024.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX flag to reduce size of shared file

I am using xlC (Version: 11.01.0000.0011). While build i am using "-g" to have debug information in build. there are many object files (>500) due to which resultant shared file (.so) will have huge size. I can't reduce optimization level. Is there any way or flag is present by using which i... (2 Replies)
Discussion started by: Abhi04
2 Replies

2. Shell Programming and Scripting

to find the size of directories

Hi, how to know the size of the files in the directory, exclusing the subfolder. ? i tried du -h du -sk du -k but its not giving.. (2 Replies)
Discussion started by: mail2sant
2 Replies

3. Shell Programming and Scripting

find with file size and show the size

Hi All... is the below command be modified in sucha way that i can get the file size along with the name and path of the file the below command only gives me the file location which are more than 100000k...but I want the exact size of the file also.. find / -name "*.*" -size +100000k ... (3 Replies)
Discussion started by: rpraharaj84
3 Replies

4. Shell Programming and Scripting

Problems with find's -newer Flag

I am writing a script that looks in a reports directory, copies a specified script to a working folder, copies some data files into the working folder, runs the report, zips the new files, then uploads them. Right now to determine what files to zip (as I don't know how many report files there... (6 Replies)
Discussion started by: droppedonjapan
6 Replies

5. Shell Programming and Scripting

how do I find the size of.....

hi all, I am new to Php. Please tell me how do I find the size of an array? Thanks (1 Reply)
Discussion started by: davidtymon
1 Replies

6. Linux

How to find out what is size of repository?

Hello, I need to know what is the size of centos 5 repository? Each centos 5 repository. 1) os 2) update 3) addons 4) centosplus 5) extras Here is the website link mirror.centos.org thanks (2 Replies)
Discussion started by: email-lalit
2 Replies

7. Shell Programming and Scripting

Find the size of a directory

Hi, I would really appreciate if you could help me with this. I have a directory structure like this :- /data Under data i have directories /data1 , /input_files , /output_files etc . Under these directories I have other subdirectories. What i am looking for is to find out the size of all... (5 Replies)
Discussion started by: divz
5 Replies

8. Shell Programming and Scripting

find file size

My Question is ----------------- Assume you've a directory (i.e /home/test/) which contains n number of files, rename all the files which has byte count more than zero (0) with .bak extension. Write shell script to achieve this output, execute the same without using". / " in front of... (6 Replies)
Discussion started by: hgriva1
6 Replies

9. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies

10. UNIX for Dummies Questions & Answers

find the file by size

Hi, Can somebody PLEASE help me. Suppose I want to find a file which has largest no of bytes in a particular directory, How do i do that. ls -s will give the size of Blocks. But I want the largest sized file and in bytes or KB OR MB. tHANKS IN advanvce. Bye Rooh :( (1 Reply)
Discussion started by: rooh
1 Replies
Login or Register to Ask a Question