Terminal Tidbits

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.

Similar Posts

  • Funkify Your Format!

    We’re taking a little break from Cryptocurrency in this edition of Tech Tails. But fear not, fellow investors! We’ll get back to it next edition.

    Lately, I’ve been fielding a lot of customer questions regarding APFS, Apple’s latest file system format so let’s talk about format types.

    APFS is the latest file system format Apple released this past year. When you install macOS High Sierra on the Mac volume of a solid-state- drive, that volume is automatically converted to APFS. Fusion Drives, traditional hard disk drives (HDD’s), and non-Mac volumes are not converted. APFS carries a huge advantage as the format type can replace all of the existing file systems Apple currently uses across its platforms. APFS is suitable for macOS, iOS, tvOS and even watchOS.

    Mac OS Extended (Journaled) is the default file system format for Mac OS drives. Formatting a drive with this will give you full interoperability with Macs. You can even set up a macOS startup drive if you have the right files, the know-how, and a large enough drive. The downside to this format is the compatibility between Mac and PC. A drive formatted as Mac OS Extended can be read by a PC, but the user will be unable to write data onto the drive. If you’re transferring files from Mac to PC this won’t be an issue, but going from PC to Mac in this format won’t work.

    MS-DOS (FAT) is Disk Utility’s name for the FAT32 file system. FAT32 offers near-universal interoperability with every computing system. A drive formatted this way can easily transfer files between Mac and PC. The drawback to this format is FAT32 does not support files larger than 4 GB.

    ExFAT essentially carries the advantages of FAT32, and bolsters this by supporting files larger than 4 GB. If transferring large files between Mac and PC, this format is for you.