41

I have a Mac that someone asks me to help them sell. They already wiped the hard drive and put a fresh installation of macOS on it. Upon boot, it's at the "Welcome" setup with no users intialized yet.

Is there an easy way to see the System Information and version of macOS currently installed on this machine without creating a new user? I'd like to leave this machine in a clean state without having to re-wipe the hard drive with a new installation.

2
  • Do you have another Mac? Want to boot in target disk mode?
    – bmike
    Commented Dec 11, 2017 at 20:29
  • @bmike Yes, but I'd prefer an answer assuming no other Mac around. Thanks! Commented Dec 11, 2017 at 21:42

7 Answers 7

42

The following assumes that the Recovery HD has the same version of macOS installed on the Macintosh HD for the accuracy of OS version information.

If you boot the Mac to Recovery Mode, you can access System Information from Terminal using the following command, e.g.:

/Volumes/Macintosh\ HD/usr/sbin/system_profiler

You might what to minimize the output and use and of the following options:

  • -listDataTypes - Lists the available datatypes.
  • -detailLevel level - Specifies the level of detail for the report:
    • mini - Report with no personal information.
    • basic - Basic hardware and network information.
    • full - All available information.

To get just a Hardware: report, use:

  • SPHardwareDataType

Example:

/Volumes/Macintosh\ HD/usr/sbin/system_profiler SPHardwareDataType

On my system the outout of the above command was:

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro10,1
      Processor Name: Intel Core i7
      Processor Speed: 2.8 GHz
      Number of Processors: 1
      Total Number of Cores: 4
      L2 Cache (per Core): 256 KB
      L3 Cache: 8 MB
      Memory: 16 GB
      Boot ROM Version: MBP101.00EE.B12
      SMC Version (system): 2.3f36
      Serial Number (system): <Information omitted for security reasons.>
      Hardware UUID: <Information omitted for security reasons.>

Notes:

To boot to the Recovery HD, press CommandR when booting the Mac. See also About macOS Recovery

Also, have a look at the manual page for system_profiler

If you want to just get information for some of the -listDataTypes listed, you can add each on the command line, e.g.:

/Volumes/Macintosh\ HD/usr/sbin/system_profiler SPHardwareDataType SPSoftwareDataType

The system_profiler command can be run directly from single-user mode, by pressing CommandS when booting the Mac, without having to provide the fully qualified pathname, however depending on how much information you want from system_profiler, you may need to pipe the output to more to less, etc., as scrolling in single-user mode is not as easy as from Terminal when booted to the Recovery HD.

That said, if all you want is the basic output shown under Hardware: and Software: from using the system_profiler command, then use the following command in single-user mode:

system_profiler SPHardwareDataType SPSoftwareDataType

Note that the software info from single-user mode is that which is install on the Macintosh HD, unlike from the Recovery HD it's that of the OS X Base System and while it should be the same, it may not. The hardware info is accurate in either case.

4
  • Macintosh\ HD is not always right, so my tip for all, try first cd /Volumes here you get all volumes (in my case it was disks02) then you can use the right volume instead of Macintosh HD, the remaining path is absolutely correct.
    – kurtanamo
    Commented Jan 8, 2020 at 15:22
  • 24
    On Catalina + Big Sur recovery mode I was getting this error: dyld: Library not loaded: /System/Library/PrivateFrameworks/SPSupport.framework/Versions/A/SPSupport. The fix was to first chroot /Volumes/Macintosh\ HD zsh. After that, /usr/sbin/system_profiler works as expected. Commented Jan 22, 2021 at 19:11
  • @NatePinchot when trying to chroot on an M1 mac, I get the error: "killed: 9". Any ideas why?
    – Ben Davis
    Commented Nov 11, 2021 at 15:31
  • I am seeing the same error that Nate is showing above, on an M1. Commented Aug 17 at 21:39
41

In my case system_profiler would not load (Abort trap: 6), and sw_vers only shows the OS version. I needed the processor, memory and disk details.

Boot into Recovery Mode, holding Command+R at boot. Then go into Utilities > Terminal

Processor

$ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz

Memory

$ sysctl -n hw.memsize
17179869184

16 GB RAM = 17179869184 / 1024 / 1024 / 1024

Disk Space

$ diskutil list
/dev/disk1 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         500.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         500.0 GB   disk0s2

500 GB

Battery

$ ioreg -rc AppleSmartBattery | grep -E '(CycleCount|Capacity)" ='
  "DesignCapacity" = 4563
  "AppleRawMaxCapacity" = 4092
  "CycleCount" = 19

89.7% = 4092 / 4563 * 100

3
  • 2
    Thanks! This was the only thing that worked on the newer M1 macs
    – Ben Davis
    Commented Nov 11, 2021 at 16:48
  • 1
    system_profiler uses the /System/Library/PrivateFrameworks/SPSupport.framework which is not on the install media. However copying this framework on to external media and accessing it there doesn't solve the problem. system_profiler will run but return no data. There must be more resources it needs available. Commented Jun 3, 2022 at 7:38
  • 1
    I didn't have system_profiler on my mac mini, and this worked perfectly. Commented Aug 4, 2022 at 9:10
6

Easy - boot to single-user mode and then shut down.

  1. Hold S key while booting (if you miss when the chime starts and the setup assistant runs - quit and shut down).
  2. When the black screen shows white text - wait for it to stop and type sw_vers.
  3. Once you’ve recorded the information, type halt.

You can use sw_vers in any mode. Its output looks like this:

$ sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.13.1
BuildVersion:   17B1003
2
  • Could you give an indication of what it shows if you do? Commented Dec 11, 2017 at 21:17
  • 1
    @Maarten Bodewes, It will output 3 lines, e.g.: ProductName: Mac OS X, Product Version: 10.13.1 and BuildVersion: 17B1003 Commented Dec 11, 2017 at 21:27
4
  1. Enter recovery mode:
    • Intel: by pressing Cmd ⌘ + R when powering on
    • M1: just press the "power on" button and keep it pressed until you see recovery options, then choose "Options"
  2. Open Utilities > Terminal
  3. Type following:
    $ sysctl hw.physicalcpu hw.logicalcpu machdep.cpu.brand_string hw.memsize
    $ diskutil info disk0
    

Where:

  • hw.physicalcpu is number of cores
  • hw.logicalcpu is number of threads
  • machdep.cpu.brand_string is CPU model info
  • hw.memsize is RAM size in bytes, just divide it by 1024^3
  • Device / Media Name is drive hardware name (device name)
  • Disk Size actual physical disk size
  • Protocol will be PCI-Express even for NVME disks, don't worry

Based on @user3439894 and @nate-pinchot answers, you can also try:

$ chroot /Volumes/Macintosh\ HD bash
$ system_profiler SPHardwareDataType SPSoftwareDataType SPPowerDataType

there will be more info, like:

  • Model Identifier
  • Serial Number
  • System Version
  • Cycle Count

In case if you using FileVault this way requires you to unlock startup disk first: After entering Recovery, login into admin user, then press  > Startup disk > Choose Macintosh HD > Remove protection > Type your password > Click "Startup drive" > Quit

2

The best way to do this and to access everything you would otherwise see in System Information is to boot into single-user mode by holding Command + S while booting up. Once you see the white-on-black text, you'll then want to then input:

system_profiler -listDataTypes

This will give you a list of all the different 'DataTypes' or more simply what type of information you can choose to see, very similar to how it's displayed in the System Information app. If, for example, you want to then see battery cycle information, you could then enter:

system_profiler SPPowerDataType

It will then print the Battery Information along with Cycle Count to the screen.

Replacing SPPowerDataType in that previous statement with any of the other listed DataTypes will also return relevant information.

0

The following is the easiest way I've found to do this:

First boot to the welcome screen, then open the apple menu at the top left (it is hidden until you move the mouse there). Once it is open hold down the option key and "About This Mac" will change to "System Information" which will open the normal system profiler.

Strangely even though "About This Mac" is there you cannot open it.

0

I just used this, but found one quirk: it does require that their be an OS installed, and doesn't work on Macs that only have a Recovery partition. However, system_profiler does exist on the Recovery partition. Follow the steps above, but instead use:

/Volumes/"OS X Base System"/usr/sbin/system_profiler SPHardwareDataType

or

 /Volumes/"macOS Base System"/usr/sbin/system_profiler SPHardwareDataType

whichever the partition is named, and it works like a charm!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .