@@ -63,6 +63,181 @@ i686 32位
6363x86_64 64位
6464```
6565
66+ 查看 cpu 逻辑核心数,型号
67+ ```
68+ $ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
69+ 4 Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
70+ ```
71+
72+ 查看物理 cpu 颗数
73+ ```
74+ $ cat /proc/cpuinfo | grep physical | uniq -c
75+ 1 physical id : 0
76+ 1 address sizes : 39 bits physical, 48 bits virtual
77+ 1 physical id : 0
78+ 1 address sizes : 39 bits physical, 48 bits virtual
79+ 1 physical id : 0
80+ 1 address sizes : 39 bits physical, 48 bits virtual
81+ 1 physical id : 0
82+ 1 address sizes : 39 bits physical, 48 bits virtual
83+ ```
84+
85+ 查看 cpu 运行模式
86+ ```
87+ $ getconf LONG_BIT
88+ 64
89+ ```
90+ 如果显示32,说明当前 CPU 运行在32bit模式下, 但不代表 CPU 不支持64bit
91+
92+ 查看 cpu 是否支持64bit
93+ ```
94+ $ cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
95+ 4
96+ ```
97+ 结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit
98+
99+ 查看 cpu 信息概要
100+ ```
101+ $ lscpu
102+ ```
103+
104+ Architecture: x86_64
105+ CPU 运行模式: 32-bit, 64-bit
106+ Byte Order: Little Endian
107+ CPU(s): 4
108+ On-line CPU(s) list: 0-3
109+ 每个核的线程数:2
110+ 每个座的核数: 2
111+ Socket(s): 1
112+ NUMA 节点: 1
113+ 厂商 ID: GenuineIntel
114+ CPU 系列: 6
115+ 型号: 69
116+ 步进: 1
117+ CPU MHz: 759.000
118+ BogoMIPS: 4589.28
119+ 虚拟化: VT-x
120+ L1d 缓存: 32K
121+ L1i 缓存: 32K
122+ L2 缓存: 256K
123+ L3 缓存: 3072K
124+ NUMA node0 CPU(s): 0-3
125+
126+
127+ 查看 cpu 详情
128+ ```
129+ $ cat /proc/cpuinfo
130+ ```
131+
132+ processor : 0
133+ vendor_id : GenuineIntel
134+ cpu family : 6
135+ model : 69
136+ model name : Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
137+ stepping : 1
138+ microcode : 0x17
139+ cpu MHz : 759.000
140+ cache size : 3072 KB
141+ physical id : 0
142+ siblings : 4
143+ core id : 0
144+ cpu cores : 2
145+ apicid : 0
146+ initial apicid : 0
147+ fpu : yes
148+ fpu_exception : yes
149+ cpuid level : 13
150+ wp : yes
151+ flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
152+ bogomips : 4589.28
153+ clflush size : 64
154+ cache_alignment : 64
155+ address sizes : 39 bits physical, 48 bits virtual
156+ power management:
157+
158+ processor : 1
159+ vendor_id : GenuineIntel
160+ cpu family : 6
161+ model : 69
162+ model name : Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
163+ stepping : 1
164+ microcode : 0x17
165+ cpu MHz : 759.000
166+ cache size : 3072 KB
167+ physical id : 0
168+ siblings : 4
169+ core id : 0
170+ cpu cores : 2
171+ apicid : 1
172+ initial apicid : 1
173+ fpu : yes
174+ fpu_exception : yes
175+ cpuid level : 13
176+ wp : yes
177+ flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
178+ bogomips : 4589.28
179+ clflush size : 64
180+ cache_alignment : 64
181+ address sizes : 39 bits physical, 48 bits virtual
182+ power management:
183+
184+ processor : 2
185+ vendor_id : GenuineIntel
186+ cpu family : 6
187+ model : 69
188+ model name : Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
189+ stepping : 1
190+ microcode : 0x17
191+ cpu MHz : 759.000
192+ cache size : 3072 KB
193+ physical id : 0
194+ siblings : 4
195+ core id : 1
196+ cpu cores : 2
197+ apicid : 2
198+ initial apicid : 2
199+ fpu : yes
200+ fpu_exception : yes
201+ cpuid level : 13
202+ wp : yes
203+ flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
204+ bogomips : 4589.28
205+ clflush size : 64
206+ cache_alignment : 64
207+ address sizes : 39 bits physical, 48 bits virtual
208+ power management:
209+
210+ processor : 3
211+ vendor_id : GenuineIntel
212+ cpu family : 6
213+ model : 69
214+ model name : Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
215+ stepping : 1
216+ microcode : 0x17
217+ cpu MHz : 759.000
218+ cache size : 3072 KB
219+ physical id : 0
220+ siblings : 4
221+ core id : 1
222+ cpu cores : 2
223+ apicid : 3
224+ initial apicid : 3
225+ fpu : yes
226+ fpu_exception : yes
227+ cpuid level : 13
228+ wp : yes
229+ flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
230+ bogomips : 4589.28
231+ clflush size : 64
232+ cache_alignment : 64
233+ address sizes : 39 bits physical, 48 bits virtual
234+ power management:
235+
236+ 查看内存信息
237+ ```
238+ $ cat /proc/meminfo
239+ ```
240+
66241[ Ubuntu设置系统防火墙] ( https://help.ubuntu.com/community/UFW )
67242
68243
0 commit comments