Most Mac users know if they want to know what’s “under the hood” of their Mac, they could boot into the OS, click on the Apple logo, and click “about this Mac”.
But, did you know you could go into Terminal, and type in “hostinfo” and hit enter?
The command host is usually used for DNS lookup and info but you can use it to find out which kernel version you’re running, how many processors you have, the amount of physical memory and the number of Mach tasks. Mach tasks are a variant of the load average, number of threads using.
The syntax looks like this
hostinfo
That’s it, there are no further options as it is a simple command. We Techs use it a lot when performing RAM upgrades and when we don’t want to wait for the Mac to boot all the way into the MacOS to see if the RAM modules are recognized.
Shut down the Mac completely, and wait a couple seconds. Then, hold down the Command and S keys simultaneously while pressing the power button to start up the Mac. You’ll hear the chime, and then a black screen will appear. Shortly thereafter, a bunch of scary white text will show up. This is single-user mode.
Here you simply type “hostinfo” and you’ll see something like this:
Mach kernel version: Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 Kernel configured for up to 8 processors. 4 processors are physically available. 8 processors are logically available. Processor type: x86_64h (Intel x86-64h Haswell) Processors active: 0 1 2 3 4 5 6 7 Primary memory available: 128.00 gigabytes Default processor set: 377 tasks, 2201 threads, 8 processors Load average: 1.95, Mach factor: 6.04
This outlines the following information about your machine:
- Mach kernel version: basically the version of the version of Darwin or the open-source Unix that your OSX is based on.
- How many actual processor cores you have, in this case we see 4 processor cores as it’s an Intel i7 processor. In this chip, each core can run 2 threads so we get…
- 8 processors logically available – 4×2=8
- The identifier of the actual main processor chip you have installed.
- An enumeration of each processor that’s active and available 0 through 7
- The amount of RAM available in your machine
- What your processor is busy doing at that moment in terms of tasks and threads
- Load average, or how busy your machine has been over the last minute. Higher numbers mean more activity.
- Mach factor, which is a variant of the load, but divided by the number of logical processors. The closer to 0, the more load the processor is experiencing. So in my example, an 8-core processor doing nothing should show pretty close to 8, whereas if it was running full speed rendering video or something, you’d see a much lower number.
When you’re finished exploring this info, simply restart you computer by typing:
reboot
This info is the tip of the iceberg of the information you can coax out of your machine from the command line but it’s a good way to get your feet wet to explore what’s possible.