Command to check the total number of CPU physical cores / logical cores / physical memory on Mac

Introduction

This post is a memorandum. I don't use it often, but I hope it helps someone.

In addition, it is a memorable (?) Qiita first post.

Check the number of CPU physical cores

Execute the command in the terminal.

$ sysctl -n hw.physicalcpu_max

Check the number of CPU logical cores

Execute the command in the terminal.

$ sysctl -n hw.logicalcpu_max

Check the total amount of physical memory

Execute the command in the terminal.

$ sysctl hw.memsize

The result is displayed in bytes, so convert it accordingly.

Summary

I want a MacBook Pro with better specifications.

Recommended Posts

Command to check the total number of CPU physical cores / logical cores / physical memory on Mac
A command to easily check the speed of the network on the console
Try to estimate the number of likes on Twitter
A script that can perform stress tests according to the number of CPU cores
Check the memory status of the server with the Linux free command
Count the number of characters in the text on the clipboard on mac
How to check the memory size of a variable in Python
How to check the memory size of a dictionary in Python
I used the worldcup command to check the outcome of the World Cup.
Check the number of prime numbers less than or equal to n
How to find out the number of CPUs without using the sar command
How to play a video while watching the number of frames (Mac)
How to access the contents of a Linux disk on a Mac (but read-only)
Visualize the timeline of the number of issues on GitHub assigned to you in Python
Calculate the total number of combinations with python
[2020July] Check the UDID of the iPad on Linux
Convert XLSX to CSV on the command line
An easy way to pad the number with zeros depending on the number of digits [Python]
Posted the number of new corona positives in Tokyo to Slack (deployed on Heroku)
Steps to use the AWS command line interface (Python / awscli) on Mac OS X
See here for the amount of free memory of the free command
Easy way to check the source of Python modules
python beginners tried to predict the number of criminals
How to know the port number of the xinetd service
How to get the number of digits in Python
Steps to install the latest Python on your Mac
Roughly estimate the total memory usage of an object
[Golang] Command to check the supported GOOS and GOARCH in a list (Check the supported platforms of the build)
How to specify an infinite number of tolerances in the numeric argument validation check of argparse
Detailed explanation How to run the sample code of UNIX programming 3rd edition on Mac
How to know the number of GPUs from python ~ Notes on using multiprocessing with pytorch ~