Find out the physical memory size in osx

Far too often I accomplish this by clicking on the apple icon on the menu bar, then click “About this Mac”, then just read from the popup window. This is perfectly fine and all, until one day I was given only a shell and I needed to get that info.

Well, here is how you can do it in command line:

sysctl -a | grep mem

Then look for hw.memsize in the list. The number is in byte size, so you will need to do some conversion in your head. For example, if you see hw.memsize = 12884901888, that’s actually 12 * 1024 * 1024 * 1024, which is 12Gb.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s