LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Command to fins system size (https://www.linuxquestions.org/questions/linux-newbie-8/command-to-fins-system-size-4175563075/)

pradeepspa 01-04-2016 03:14 PM

Command to fins system size
 
Hi All,

First of all mind me asking so basic question. if someone ask to find the size of the linux system what command will be useful?

Its a VM where I could find its size through vspehere. i am just checking those size correlates with command line.

In Vsphere it shows,
Provisioned Storage : 244 GB
used Storage : 166.57 GB

In Cmd Line:
I used "parted -l", adding upthe memory it shows in each disk it comes around 244gb.

Where i could I see used size?

suicidaleggroll 01-04-2016 03:19 PM

"df -h" will show the total, used, and available space for all mounted partitions.

pradeepspa 01-04-2016 03:38 PM

In "df -h", When i add used size it shows 135 gb where vshpere shows the used space as 166gb

exvor 01-04-2016 04:38 PM

I would bet the difference in sizes there is due to some buffering by vsphere for the file system in use.

Hasek39 01-04-2016 04:52 PM

If you want to know the volume of free and used space in the whole system than
Code:

df -h
and if you are interested in any directory
Code:

du -h /path/to/directory/

jpollard 01-04-2016 05:03 PM

Quote:

Originally Posted by pradeepspa (Post 5473019)
In "df -h", When i add used size it shows 135 gb where vshpere shows the used space as 166gb

Quite possibly you are forgetting round off in the numbers presented, or possibly the difference between a 1024 and 1000 base unit size...

pradeepspa 01-05-2016 07:29 AM

Quote:

Originally Posted by jpollard (Post 5473052)
Quite possibly you are forgetting round off in the numbers presented, or possibly the difference between a 1024 and 1000 base unit size...

Thanks for the response. If it would be round off why its like 30 gb of difference

jpollard 01-05-2016 07:53 AM

Quote:

Originally Posted by pradeepspa (Post 5473303)
Thanks for the response. If it would be round off why its like 30 gb of difference

1GB < 1Gib; 1GB 1,000,000,000 bytes, 1GiB = 1,073,741,824, for a difference of 73,741,824 bytes. It adds up.

roundoff tends to drop things below a tenth of a GB, and that can also add to the error (and I'm not sure of the rounding method used here - it could be truncation, or conversion to a string... then trimmed), and there is the possible rounding from integers to float... which isn't accurate for really large numbers.


All times are GMT -5. The time now is 03:49 PM.