[NTLUG:Discuss] find: 1G < 1024M?

Stuart Johnston saj at thecommune.net
Tue Oct 19 13:57:19 CDT 2010


I have this command to find files smaller than a particular size:

find ./ -regex ".*\.[mn][pu][gv]" -size -1G -type f -exec ls -lh {} \; | 
awk '{ print $8 ": " $5 }'

This prints nothing.  If I change it to use -1024M, it gives the 
expected output:

find ./ -regex ".*\.[mn][pu][gv]" -size -1024M -type f -exec ls -lh {} 
\; | awk '{ print $8 ": " $5 }'
./1211_20100930175900.nuv: 736M
./1211_20100927175900.nuv: 741M
./1211_20100922175900.nuv: 736M


Any ideas why -1G is not working the way I'm expecting?



More information about the Discuss mailing list