GitHub - hcarvalhoalves/lscpumac: A macOS shell script that displays CPU and system information in the same format as the Linux `lscpu` command. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
hcarvalhoalves
lscpumac
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>2 Commits<br>2 Commits
LICENSE
LICENSE
README.md
README.md
lscpumac
lscpumac
View all files
Repository files navigation
lscpumac
A macOS shell script that displays CPU and system information in the same format as the Linux lscpu command.
Linux's lscpu is not available on macOS. This script replicates its output by querying the macOS kernel directly via sysctl, presenting fields like architecture, CPU topology, clock speeds, cache sizes, and memory in the familiar two-column layout.
Usage
lscpumac
Example output (Apple Silicon)
Architecture: arm64<br>CPU op-mode(s): 64-bit<br>Byte Order: Little Endian<br>CPU(s): 12<br>On-line CPU(s) list: 0-11<br>Thread(s) per core: 1<br>Core(s) per socket: 12<br>Socket(s): 1<br>Model name: Apple M2 Pro<br>CPU MHz: 3504.000<br>L1d cache: 128K<br>L1i cache: 192K<br>L2 cache: 16M<br>Cache line: 128B<br>Memory: 16Gi
Example output (Intel x86)
Architecture: x86_64<br>CPU op-mode(s): 32-bit, 64-bit<br>Byte Order: Little Endian<br>CPU(s): 8<br>On-line CPU(s) list: 0-7<br>Thread(s) per core: 2<br>Core(s) per socket: 4<br>Socket(s): 1<br>Vendor ID: GenuineIntel<br>CPU family: 6<br>Model: 158<br>Model name: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz<br>Stepping: 10<br>CPU MHz: 2200.000<br>CPU max MHz: 4100.000<br>CPU min MHz: 800.000<br>Virtualisation: VT-x<br>L1d cache: 32K<br>L1i cache: 32K<br>L2 cache: 256K<br>L3 cache: 9M<br>Cache line: 64B<br>Memory: 16Gi
Fields are silently omitted when the underlying sysctl key is unavailable (for example, Intel-specific fields like Vendor ID and Virtualisation are not shown on Apple Silicon).
Dependencies
Tool<br>Notes
bash 3.2+<br>Ships with macOS since 10.3
sysctl<br>Ships with macOS; provides all CPU and memory data
uname<br>Ships with macOS; used to detect the CPU architecture
awk<br>Ships with macOS; used for arithmetic formatting (MHz, cache sizes, memory)
grep<br>Ships with macOS; used to extract frequency from the CPU brand string on Apple Silicon
No third-party tools, Homebrew packages, or interpreters (Python, Ruby, etc.) are required. The script runs with what every macOS installation provides out of the box.
About
A macOS shell script that displays CPU and system information in the same format as the Linux `lscpu` command.
Resources
Readme
License
BSD-2-Clause license
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
stars
Watchers
watching
Forks
forks
Report repository
Releases
No releases published
Packages
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Awk<br>100.0%
You can’t perform that action at this time.