1820880 Members
3620 Online
109628 Solutions
New Discussion юеВ

How many Gigs do I have

 
SOLVED
Go to solution
Shar Hunter
Frequent Advisor

How many Gigs do I have

I know that I have
8,192,000 Kbytes.
3,796,742 blocks
8192 bytes in a block.

How the heck do I figure out how many megs or gigs I have.

I am thinking it is as easy as
819 megs
8 gigs.

Thanks!
I don't think I'm in Kansas anymore.
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor
Solution

Re: How many Gigs do I have

Hi,

Devide by 1024 to get the next high metric

For ex.,

KB to MB

8192000/1024 = 8000 MB

MB to GB

8000/1024 ~ 7.8 GB

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

Re: How many Gigs do I have

8190000/1024 = megabyutes

/1024 = Gigabytes

blocks times bytes = bytes total

/1024 = KB
/1024 = MB
/1024 = GB

Not so easy.

Not very hard though.

Take a look at the source code of the script I'm attaching for reference.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Robert Kerr
Advisor

Re: How many Gigs do I have

At 8,192,000K 8gigs would be a "ballpark" to just eye it by thousands, but it would actually be just shy of 8 because your incrementally dividing by 1024:
(8,192,000/1024=8000 megs, then 800/1024 to get 7.8125 gigs)
Bill Hassell
Honored Contributor

Re: How many Gigs do I have

This is an intersting topic as newbies to the world of computer numbering. Advertisers noted that 1000 is less than 1024 and the terms kilo, mega and giga refer to orders of magnitude which might be 10^3 (1000) or 1024. Well, when it comes to marketing, bigger is always better and you'll often find 1meg might be 1,000,000 or it might be 1,048,576. So when you talk about a 100meg disk, the actual byte capacity might be 50,000,000 but that translates about 47.7 megs when a meg is 1,048,576.

I've attached a script that I call lls (long listing sorted by size) which uses K,M,G units to represent the file size and at the top of the script, you can choose 1000 or 1024 as the unit of magnitude.


Bill Hassell, sysadmin