Mac/Linux/Windows : Get CPU information from command line
Writing these down here for future references, will be handy with comes to identifying a machine's CPU information during system maintenance time. Below are the command line tools to get the CPU information in Windows, Mac OS X and Linux.
Linux:
$cat /proc/cpuinfo
Mac OS X:
$sysctl -n machdep.cpu.brand_string
Windows 8 and above:
C:>wmic cpu full /format:list
NOTE: For Windows, without the /format:list
... the output result will be almost impossible to read. You can choose to use /format:htable
for HTML, /format:csv
for csv format or /format:xml
for xml format as well.
References:
https://adamscheller.com/systems-administration/find-cpu-model-linux/
http://osxdaily.com/2011/07/15/get-cpu-info-via-command-line-in-mac-os-x/
http://www.pearsonitcertification.com/articles/article.aspx?p=1700427&seqNum=4
See also : Golang : Get hardware information such as disk, memory and CPU usage
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+16.1k Golang : Check if IP address is version 4 or 6
+6.6k Golang : Detect sample rate, channels or latency with PortAudio
+15.8k Golang : Get number of CPU cores
+5.7k Unix/Linux : How to get own IP address ?
+10k Golang : Create S3 bucket with official aws-sdk-go package
+5.7k Golang : Skip or discard items of non-interest when iterating example
+7.5k Android Studio : Image button and button example
+7.1k Golang : Append and add item in slice
+6.3k Golang : Dealing with postal or zip code example
+9.4k Generate Random number with math/rand in Go
+8.9k Golang : Check if user agent is a robot or crawler example
+10.8k Golang : Detect user location with HTML5 geo-location