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
+6k Golang & Javascript : How to save cropped image to file on server
+14.2k Golang : Send email with attachment(RFC2822) using Gmail API example
+11.2k Android Studio : Create custom icons for your application example
+7k CloudFlare : Another way to get visitor's real IP address
+33.7k Golang : Call a function after some delay(time.Sleep and Tick)
+9.1k Golang : Timeout example
+7.1k Golang : File system scanning
+24.2k Golang : How to print rune, unicode, utf-8 and non-ASCII CJK(Chinese/Japanese/Korean) characters?
+15.1k Golang : Delete certain files in a directory
+8k Golang : Qt splash screen with delay example
+18.2k Golang : How to get hour, minute, second from time?
+21.8k Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."