The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Get System Information On A Mac From The Command Line

TODO: Pull subtitle into page object

This gets you the hardware model name:

code_start_default_section code_end_default_section
Results
MacBookPro18,4

it's weird that that works, but it doesn't show up if you do

Code
sysctl -a | grep model

Commands:

system_profiler sw_vers uname

Code

sysctl -a

kern.ostype: Darwin kern.osrelease: 21.3.0 kern.osproductversion: 12.2.1 kern.osproductversioncompat: 10.16 hw.memsize: 68719476736 hw.activecpu: 10 hw.cpufamily: 458787763 hw.cputype: 16777228 hw.logicalcpu: 10 hw.logicalcpu_max: 10 hw.physicalcpu: 10 hw.physicalcpu_max: 10 machdep.cpu.brand_string: Apple M1 Max machdep.cpu.core_count: 10 kern.version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 kern.osversion: 21D62

Things on an AWS EC2 Ubuntu 22_04 machine:

kernel.osrelease = 5.15.0-1019-aws kernel.ostype = Linux

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Get System Information On A Mac From The Command Line

-- p

This gets you the hardware model name:

-- code/
-- shell

sysctl hw.model | sed 's/^.*: //'

-- /code

-- results/

MacBookPro18,4

-- /results

-- p

it's weird that that works, but it doesn't show up if you do

-- code

sysctl -a | grep model

-- p

Commands:

-- p

system_profiler
sw_vers
uname

-- p

-- code

-- p

sysctl -a

-- p

kern.ostype: Darwin
kern.osrelease: 21.3.0
kern.osproductversion: 12.2.1
kern.osproductversioncompat: 10.16
hw.memsize: 68719476736
hw.activecpu: 10
hw.cpufamily: 458787763
hw.cputype: 16777228
hw.logicalcpu: 10
hw.logicalcpu_max: 10
hw.physicalcpu: 10
hw.physicalcpu_max: 10
machdep.cpu.brand_string: Apple M1 Max
machdep.cpu.core_count: 10
kern.version: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
kern.osversion: 21D62

-- p

Things on an AWS EC2 Ubuntu 22_04 machine:

-- p

kernel.osrelease = 5.15.0-1019-aws
kernel.ostype = Linux


-- categories
-- Command Line 
-- Mac 

-- metadata
-- date: 2022-10-02 12:41:08
-- id: 2fasnre9
-- status: scratch 
-- type: post
-- site: aws