[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "ls -h -l" returns 255GB, while "ls -l" returns 272 gigabytes
From: |
Brian Dessent |
Subject: |
Re: "ls -h -l" returns 255GB, while "ls -l" returns 272 gigabytes |
Date: |
Wed, 25 Oct 2006 11:50:18 -0700 |
"Jameson C. Burt" wrote:
> Upon rebooting, the resulting filesize listed with "ls" is inconsistent,
> ls -h -l partition.img
> -rw-r--r-- 1 root root 255G 2006-10-24 23:10 partition.img
> ls -l partition.img
> -rw-r--r-- 1 root root 272751509504 2006-10-24 23:10 partition.img
The only thing inconsistent here is your understanding of the units, I'm
afraid.
HD manufacturers use the definition of GB = 10**9, because it makes
their drives look bigger. Everyone else in the computer industry uses
the definition of GB = 1024**3 (= 2**30), which is what actually makes
sense since the disk is allocated in sectors of 512 bytes each, and most
operations on computers occur in units of base-2 sizes. So that is what
you get when you use ls -h, as that is the widely used custom when
working with sizes.
Technically, the power-of-2 based units should be referred to as
Gibibyte, Mebibyte, Kibibyte, et al. and the power-of-10 based units
referred to as Gigabyte, Megabyte, Kilobyte. But that is not common
usage anywhere in the industry except for perhaps the HD manufacturers
since it gives them a small advantage.
So when you buy a "250GB" hard drive you are getting 250 billion bytes,
which is actually a factor of (1000/1024)**3 smaller in GB.
Brian