Ubuntu: File size stated is bigger than expected



Question:

The Ubuntu file system says my file is 5.2MB. When I right click on the file I can see the file size in bytes is stated as 5,154,017.

File properties screen grab

Doing some simple maths we can calculate that in MB:

5154017 / 1024 = 5033.219726562KB

5033.219726562 / 1024 = 4.915253639MB

How does Ubuntu determine the 'rounded' value of the file size displayed in the files dialog? - This question may not be Ubuntu specific.

It does not appear to be using normal rounding e.g. half up which would display as 5MB.


Solution:1

Ubuntu always makes the distinction between base-10 prefixes (kilo, mega, giga, etc) and base-2 prefixes (kibi, mebi, gibi, etc). That is, you will never see mebibytes (mis)labeled as megabytes. So in this case, 5.154 MB rounds to 5.2 MB.

See Units Policy on the wiki for more details.


Solution:2

Ubuntu uses the
bytes > kilobytes > megabytes system
(1000 bytes = 1 kilobytes, 1000 kilobytes = 1 megabytes)
instead of the
bytes > kibibytes > mebibytes system
(1024 bytes = 1 kibibytes, 1024 kibibytes = 1 mebibytes).

So 5154017 bytes = 5.154017 megabytes ≈ 5.2 megabytes.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »