mac os lscpu 【转】
CPU Information on Linux and OS X
This is small blog post detailing how to obtain information on your CPU on Linux and Mac OSX. These commands give information such as the instruction set of the processor, the type of processor, the number of cores, number of CPUs, information about the caches etc.
Linux :
In Linux, the “proc” file system is providing most of the important information on the system. It interfaces with the kernel to obtain these information and is mounted as “/proc” on most of the Unix machines. More information can be found here.
The command to obtain information is this one.
1
|
$ /proc/cpuinfo
|
If using GCC to compile C programs, you might want to use the “-march=cpu-type” to optimise your compilation to your type of processor and it’s set of instructions, to do that you can use use the following command :
1
|
$ grep flags /proc/cpuinfo
|
Another useful command on multiple linux distributions is this one :
1
|
$ lscpu
|
The command try to display information on your CPU in a human readable format but do not include all the information available.
OS X :
On OS X mountain lion and probably some other versions, the commands to use are a bit different, some general information about the system can be found by using the “system_profiler” command. This command includes some simple information on the system in use:
1
|
$ system_profiler
|
However more dedicated information can be found by using the “sysctl” command which is an interface to dynamically change system variables and obtain detailed informations on the system. This command is also present on BSD systems.
1
|
$ sysctl hw
|
This command will give you the following type of output :
hw.byteorder: 1234
hw.memsize: 8589934592
hw.activecpu: 4
hw.physicalcpu: 2
hw.physicalcpu_max: 2
hw.logicalcpu: 4
hw.logicalcpu_max: 4
hw.cputype: 7
hw.cpusubtype: 4
hw.cpu64bit_capable: 1
hw.cpufamily: 1463508716
hw.cacheconfig: 4 2 2 4 0 0 0 0 0 0
hw.cachesize: 8589934592 32768 262144 4194304 0 0 0 0 0 0
hw.pagesize: 4096
hw.busfrequency: 4800000000
hw.busfrequency_min: 4800000000
hw.busfrequency_max: 4800000000
hw.cpufrequency: 2800000000
hw.cpufrequency_min: 2800000000
hw.cpufrequency_max: 2800000000
hw.cachelinesize: 64
hw.l1icachesize: 32768
hw.l1dcachesize: 32768
hw.l2cachesize: 262144
hw.l3cachesize: 4194304
hw.tbfrequency: 1000000000
hw.packages: 1
hw.optional.floatingpoint: 1
hw.optional.mmx: 1
hw.optional.sse: 1
hw.optional.sse2: 1
hw.optional.sse3: 1
hw.optional.supplementalsse3: 1
hw.optional.sse4_1: 1
hw.optional.sse4_2: 1
hw.optional.x86_64: 1
hw.optional.aes: 1
hw.optional.avx1_0: 0
hw.optional.rdrand: 0
hw.optional.f16c: 0
hw.optional.enfstrg: 0
hw.cputhreadtype: 1
hw.machine = x86_64
hw.model = MacBookPro6,2
hw.ncpu = 4
hw.byteorder = 1234
hw.physmem = 2147483648
hw.usermem = 877899776
hw.pagesize = 4096
hw.epoch = 0
hw.vectorunit = 1
hw.busfrequency = 4294967295
hw.cpufrequency = 2800000000
hw.cachelinesize = 64
hw.l1icachesize = 32768
hw.l1dcachesize = 32768
hw.l2settings = 1
hw.l2cachesize = 262144
hw.l3settings = 1
hw.l3cachesize = 4194304
hw.tbfrequency = 1000000000
hw.memsize = 8589934592
hw.availcpu = 4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
hw.ncpu: 4
hw.byteorder: 1234
hw.memsize: 8589934592
hw.activecpu: 4
hw.physicalcpu: 2
hw.physicalcpu_max: 2
hw.logicalcpu: 4
hw.logicalcpu_max: 4
hw.cputype: 7
hw.cpusubtype: 4
hw.cpu64bit_capable: 1
hw.cpufamily: 1463508716
hw.cacheconfig: 4 2 2 4 0 0 0 0 0 0
hw.cachesize: 8589934592 32768 262144 4194304 0 0 0 0 0 0
hw.pagesize: 4096
hw.busfrequency: 4800000000
hw.busfrequency_min: 4800000000
hw.busfrequency_max: 4800000000
hw.cpufrequency: 2800000000
hw.cpufrequency_min: 2800000000
hw.cpufrequency_max: 2800000000
hw.cachelinesize: 64
hw.l1icachesize: 32768
hw.l1dcachesize: 32768
hw.l2cachesize: 262144
hw.l3cachesize: 4194304
hw.tbfrequency: 1000000000
hw.packages: 1
hw.optional.floatingpoint: 1
hw.optional.mmx: 1
hw.optional.sse: 1
hw.optional.sse2: 1
hw.optional.sse3: 1
hw.optional.supplementalsse3: 1
hw.optional.sse4_1: 1
hw.optional.sse4_2: 1
hw.optional.x86_64: 1
hw.optional.aes: 1
hw.optional.avx1_0: 0
hw.optional.rdrand: 0
hw.optional.f16c: 0
hw.optional.enfstrg: 0
hw.cputhreadtype: 1
hw.machine = x86_64
hw.model = MacBookPro6,2
hw.ncpu = 4
hw.byteorder = 1234
hw.physmem = 2147483648
hw.usermem = 877899776
hw.pagesize = 4096
hw.epoch = 0
hw.vectorunit = 1
hw.busfrequency = 4294967295
hw.cpufrequency = 2800000000
hw.cachelinesize = 64
hw.l1icachesize = 32768
hw.l1dcachesize = 32768
hw.l2settings = 1
hw.l2cachesize = 262144
hw.l3settings = 1
hw.l3cachesize = 4194304
hw.tbfrequency = 1000000000
hw.memsize = 8589934592
hw.availcpu = 4
|
As you can see, the command is displaying specific informations such as the instruction set supported by your processor amongst many other information. For more information on the sysctl command use RTFM.
Have fun.
mac os lscpu 【转】的更多相关文章
- Xamarin+Prism开发详解四:简单Mac OS 虚拟机安装方法与Visual Studio for Mac 初体验
Mac OS 虚拟机安装方法 最近把自己的电脑升级了一下SSD固态硬盘,总算是有容量安装Mac 虚拟机了!经过心碎的安装探索,尝试了国内外的各种安装方法,最后在youtube上找到了一个好方法. 简单 ...
- Mac OS 使用 Vagrant 管理虚拟机(VirtualBox)
Vagrant(官网.github)是一款构建虚拟开发环境的工具,支持 Window,Linux,Mac OS,Vagrant 中的 Boxes 概念类似于 Docker(实质是不同的),你可以把它看 ...
- Mac OS、Ubuntu 安装及使用 Consul
Consul 概念(摘录): Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置.与其他分布式服务注册与发现的方案,比如 Airbnb 的 SmartStac ...
- 让 ASP.NET vNext 在 Mac OS 中飞呀飞。。。
写在前面 阅读目录: 娓娓道来 Install ASP.NET vNext Command Line Tools 安装 Homebrew 使用 Homebrew,安装 KVM Install Subl ...
- Atitit mac os 版本 新特性 attilax大总结
Atitit mac os 版本 新特性 attilax大总结 1. Macos概述1 2. 早期2 2.1. Macintosh OS (系统 1.0) 1984年2 2.2. Mac OS 7. ...
- 【转】[fix] Wireshark error: There are no interfaces on which a capture can be done. on Mac OS X
I got the following error message when trying to open a network interface for capture using Wireshar ...
- Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境
准备工作 新版的 Mac OS 内置了Apache 和 PHP,我的系统版本是OS X 10.9.3,可以通过以下命令查看Apache和PHP的版本号: httpd -v Server version ...
- 【转】windows环境下安装win8.1+Mac OS X 10.10双系统教程
先要感谢远景论坛里的各位大神们的帖子 没有他们的分享我也不能顺利的装上Mac OS X 10.10! 写这篇随笔主要是为了防止自己遗忘,同时给大家分享下我的经验. 本教程适用于BIOS+MBR分区的 ...
- win10 Vmware12装mac os X10.11虚拟机教程
1.下载安装VMware 12,具体教程在网上都能看见. 2.下载mac os的镜像,最好下载cdr格式的. 3.在导入虚拟机的时候,到选择客户机操作系统的时候,没有网上出现的Mac os,如下图所示 ...
随机推荐
- 服务器端 CentOS 下配置 JDK 和 Tonmcat 踩坑合集
一.配置 JDK 时,在 /etc/profile 文件下配置环境变量,添加 #java environment export JAVA_HOME=/usr/java/jdk- export CL ...
- Microsoft SQL Server学习(二)--数据库的语法
关于数据库的语法 创建数据库 样例 名词概念 编写数据库代码的注意事项 关于文件语法 实例代码 关于数据库的语法: 1.创建数据库 create database 数据库名 on primary (主 ...
- sql server 数据分析优化实战(一)——SQL语句优化
前言 在我们进行数据分析的时候,首要的目标是根据业务逻辑,通过编写SQL代码得到我们想要的结果,这是毋庸置疑的.一般情况下,由于我们分析的数据量比较少,体会不出SQL语句各种写法的性能优劣,对SQL代 ...
- JS——Boolean(逻辑)对象
Boolean(逻辑)对象用于将非逻辑值转换为逻辑值(true 或者 false). 创建 Boolean 对象的语法: new Boolean(value); //构造函数 Boolean(valu ...
- Git学习总结二(版本回退)
修改修改仓库中readme.txt文件,然后用git status命令看看结果: $ git status On branch master Changes not staged for commit ...
- BZOJ 2096: [Poi2010]Pilots 单调队列
Code: #include<bits/stdc++.h> #define maxn 4000000 using namespace std; void setIO(string s) { ...
- exist not exist 分析
结果集1 结果集2: 最后连接条件 执行过程: 一行一行遍历结果集1的数据,然后结果集1中的连接条件执行子查询,如果有值返回那么在看是exist 还是not exist 在决定最后的结果集是否要要不 ...
- JDK5-8特性归纳
jdk5新特性1.自动装箱和拆箱2.枚举3.静态导入4.可变参数5.內省 是Java语言对Bean类属性.事件的一种缺省处理方法.例如类A中有属性那么,那我们可以通过getName,setName ...
- 观察者模式之Golang实现
观察者模式的具体概念原理,参见https://baike.baidu.com/item/%E8%A7%82%E5%AF%9F%E8%80%85%E6%A8%A1%E5%BC%8F/5881786?fr ...
- 爬虫系列(三) urllib的基本使用
一.urllib 简介 urllib 是 Python3 中自带的 HTTP 请求库,无需复杂的安装过程即可正常使用,十分适合爬虫入门 urllib 中包含四个模块,分别是 request:请求处理模 ...