有时候回去查看Linux的版本信息和内核,每次可能都需要百度一下,今天记录一下,方便以后自己看。
显示正在运行的内核版本。
1、cat /proc/version结果如下:
Linux version 4.4.0-116-generic (buildd@lgw01-amd64-021) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018显示电脑以及操作系统的相关信息。
2、uname -a结果如下:
Linux master 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux1、列出所有版本信息。这个命令适用于所有的Linux发行版,包括RedHat、SUSE、Debian…等发行版,但是在debian下要安装lsb
1、lsb_release -a结果如下、
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.4 LTS Release: 16.04 Codename: xenial这种方法只适合Redhat系的Linux
2、cat /etc/redhat-release结果如下:
Ubuntu系统如下: cat: /etc/redhat-release: No such file or directory centos系统如下: CentOS Linux release 7.8.2003 (Core)此命令也适用于所有的Linux发行版、显示的是发行版本信息。
3、cat /etc/issue结果如下:
Ubuntu系统如下: Ubuntu 16.04.4 LTS \n \l centos系统如下: \S Kernel \r on an \mLinux查看cpu相关信息,包括型号、主频、内核信息等
cat /proc/cpuinfo 1、centos系统如下: processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 79 model name : Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz stepping : 1 microcode : 0xb00002e cpu MHz : 2399.998 cache size : 25600 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 20 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt arat spec_ctrl intel_stibp arch_capabilities bogomips : 4799.99 clflush size : 64 cache_alignment : 64 address sizes : 43 bits physical, 48 bits virtual power management: 2、Ubuntu系统: 显示太多了,就不粘贴了。 3、每个项代表具体信息: processor:系统中逻辑处理核的编号。对于单核处理器,则课认为是其CPU编号,对于多核处理器则可以是物理核、或者使用超线程技术虚拟的逻辑核 vendor_id:CPU制造商 cpu family:CPU产品系列代号 model:CPU属于其系列中的哪一代的代号 model name:CPU属于的名字及其编号、标称主频 stepping:CPU属于制作更新版本 cpu MHz:CPU的实际使用主频 cache size:CPU二级缓存大小 physical id:单个CPU的标号 siblings:单个CPU逻辑物理核数 core id:当前物理核在其所处CPU中的编号,这个编号不一定连续 cpu cores:该逻辑核所处CPU的物理核数 apicid:用来区分不同逻辑核的编号,系统中每个逻辑核的此编号必然不同,此编号不一定连续 fpu:是否具有浮点运算单元(Floating Point Unit) fpu_exception:是否支持浮点计算异常 cpuid level:执行cpuid指令前,eax寄存器中的值,根据不同的值cpuid指令会返回不同的内容 wp:表明当前CPU是否在内核态支持对用户空间的写保护(Write Protection) flags:当前CPU支持的功能 bogomips:在系统内核启动时粗略测算的CPU速度(Million Instructions Per Second) clflush size:每次刷新缓存的大小单位 cache_alignment:缓存地址对齐单位 address sizes:可访问地址空间位数 power management :对能源管理的支持,有以下几个可选支持功能: ts:temperature sensor fid:frequency id control vid:voltage id control ttp:thermal trip tm: stc: 100mhzsteps: hwpstate:只为方便自己日后查看,如果写的有问题欢迎沟通。
