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

./aal al_h at technologist.com
Tue Oct 19 22:39:57 CDT 2010


On Tue, Oct 19, 2010 at 5:57 PM, Wayne Walker
<wwalker at solid-constructs.com> wrote:

>> Any ideas why -1G is not working the way I'm expecting?
>
> My _guess_ is granularity.  -1G means "less than 1G".  somehow that
> means 0G which is 0 bytes.
>
> [wwalker at speedy ~] [] $ cd /dev/shm
> [wwalker at speedy shm] [] $ mkdir foo
> [wwalker at speedy shm] [] $ cd foo
> [wwalker at speedy shm] [] $ dd if=/dev/zero bs=1048576 of=1m count=1
> 1+0 records in
> 1+0 records out
> 1048576 bytes (1.0 MB) copied, 0.00148686 s, 705 MB/s
> [wwalker at speedy shm] [] $ dd if=/dev/zero bs=1048576 of=100m count=100
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB) copied, 0.0966602 s, 1.1 GB/s
> [wwalker at speedy shm] [] $ dd if=/dev/zero bs=1048576 of=1023m count=1023
> 1023+0 records in
> 1023+0 records out
> 1072693248 bytes (1.1 GB) copied, 1.16221 s, 923 MB/s
> [wwalker at speedy shm] [] $ dd if=/dev/zero bs=1048576 of=1025m count=1025
> 1025+0 records in
> 1025+0 records out
> 1074790400 bytes (1.1 GB) copied, 4.33152 s, 248 MB/s
> [wwalker at speedy foo] [] $ find . -size -1024M
> .
> ./1m
> ./1023m
> ./100m
> [wwalker at speedy foo] [] $ find . -size -1G
> [wwalker at speedy foo] [] $ touch 0b
> [wwalker at speedy foo] [] $ find . -size -1G
> ./0b
> [wwalker at speedy foo] [] $ ls -l
> total 2204904
> -rw-rw-r-- 1 wwalker wwalker          0 Oct 19 17:54 0b
> -rw-rw-r-- 1 wwalker wwalker  104857600 Oct 19 17:52 100m
> -rw-rw-r-- 1 wwalker wwalker 1072693248 Oct 19 17:53 1023m
> -rw-rw-r-- 1 wwalker wwalker 1074790400 Oct 19 17:53 1025m
> -rw-rw-r-- 1 wwalker wwalker    1048576 Oct 19 17:52 1m
> [wwalker at speedy foo] [] $ find . -size -1024M
> .
> ./0b
> ./1m
> ./1023m
> ./100m
> [wwalker at speedy foo] [] $ find . -size -1G
> ./0b
>


Nicely demo'd Waye


-- 
-- NOT sent from an iphone,blackberry,Nokia, or any handheld. --

I'm a PC(x86 AND ppc)
AND I RUN LINUX!!!
Linux is like ice cream. It comes in many flavors and everyone has
their favorite, but we all get the same smile regardless of which we
choose to scoop.
-



More information about the Discuss mailing list