Computing.Net > Forums > Unix > List files size less than 20KB

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

List files size less than 20KB

Reply to Message Icon

Name: Siow Wei
Date: January 8, 2003 at 00:36:35 Pacific
OS: Win 2000
CPU/Ram: 256
Comment:

Hi all,
Can I know if the following command is correct to list files that have size less than 20KB :
$find . -size -20

The '-' sign for '-20', what does that mean? There is a difference when I change '-' to '+'. But I am not sure what is the difference.
Thank you!!



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: January 8, 2003 at 06:19:07 Pacific
Reply:

Have a look at the man page for find. The '-' means less than. The '+' means greater than. The integer passed to the size flag is in 512 byte blocks. So find . -size -20 is really saying find all the files less than 10K.

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


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: List files size less than 20KB

List files newer than 10 days www.computing.net/answers/unix/list-files-newer-than-10-days/4440.html

long listing of commands www.computing.net/answers/unix/long-listing-of-commands/4486.html

Comparing file sizes in korn script www.computing.net/answers/unix/comparing-file-sizes-in-korn-script/2776.html