Linux下查看系统配置

作者:神秘网友 发布时间:2021-02-16 09:20:08

Linux下查看系统配置

CPU

1. lscpu:显示cpu架构信息

[xxx@localhost ~]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4          #总处理器核心数量
On-line CPU(s) list:   0-3
Thread(s) per core:    1          #每个核心支持的线程数量。1表示只支持一个线程,即不支持超线程
Core(s) per socket:    1          #每个处理器的核心数量
Socket(s):             4          #处理器数量
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Stepping:              0
CPU MHz:               2599.998
BogoMIPS:              5199.99
Hypervisor vendor:     VMware       #管理程序供应商
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              30720K
NUMA node0 CPU(s):     0-3

总处理器核心数量=处理器数量*每个处理器的核心数量*每个核心支持的线程数量。即:CPU(s) = Socket(s) * Core(s) * Thread(s)。

我们看一下MAN中是如何描述的:

[xxx@localhost ~]$ man lscpu
   COLUMNS
       CPU    The logical CPU number of a CPU as used by the Linux kernel.    #逻辑CPU数量
       CORE   The logical core number. A core can contain several CPUs.      #逻辑核心数量
       SOCKET The logical socket number. A socket can contain several cores.   #逻辑插槽(路)数量

2. cat /proc/cpuinfo:查看CPU详细信息

[xxx@localhost ~]$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz
stepping        : 0
cpu MHz         : 2599.998
cache size      : 30720 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dts
bogomips        : 5199.99
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz
stepping        : 0
cpu MHz         : 2599.998
cache size      : 30720 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dts
bogomips        : 5199.99
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz
stepping        : 0
cpu MHz         : 2599.998
cache size      : 30720 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dts
bogomips        : 5199.99
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz
stepping        : 0
cpu MHz         : 2599.998
cache size      : 30720 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dts
bogomips        : 5199.99
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

这样输出的话,内容有些多,看起来会有些混乱。我们可以用几条命令来查看我们想要知道的信息:

# 查看物理CPU个数
cat /proc/cpuinfo | grep "physical id" | sort | uniq

# 查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo | grep "cpu cores" | uniq

# 查看每个物理CPU中线程的个数
cat /proc/cpuinfo | grep "siblings" | uniq

# 查看逻辑CPU的个数
cat /proc/cpuinfo| grep "processor"

# 查看CPU型号
cat /proc/cpuinfo | grep "model name" | uniq

内存

查看/proc/meminfo或者使用free命令。free命令就是从meminfo中获取的信息。一般情况下,使用free就能得到我们想知道的信息:

[xxx@localhost ~]$ free -m
             total       used       free     shared    buffers     cached
Mem:          7868        954       6914          0         64        619
-/+ buffers/cache:        271       7597
Swap:         4031          0       4031

可以看出,内存大小是8G。

硬盘

1. lsblk:blk是block的缩写。列出块设备

[xxx@localhost ~]$ lsblk
NAME                        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                          11:0    1 1024M  0 rom  
sdb                           8:16   0  100G  0 disk 
└─sdb1                        8:17   0  100G  0 part /data
sda                           8:0    0   60G  0 disk 
├─sda1                        8:1    0  500M  0 part /boot
└─sda2                        8:2    0 59.5G  0 part 
  ├─VolGroup-lv_root (dm-0) 253:0    0   50G  0 lvm  /
  ├─VolGroup-lv_swap (dm-1) 253:1    0    4G  0 lvm  [SWAP]
  └─VolGroup-lv_home (dm-2) 253:2    0  5.6G  0 lvm  /home

其中,TYPE=disk表示硬盘。可以看出,硬盘分为sda和sdb,一共160G。

2. df:查看硬盘使用情况

[xxx@localhost ~]$ df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   50G  1.7G   46G   4% /
tmpfs                         3.9G     0  3.9G   0% /dev/shm
/dev/sda1                     485M   39M  421M   9% /boot
/dev/mapper/VolGroup-lv_home  5.5G  165M  5.1G   4% /home
/dev/sdb1                      99G  188M   94G   1% /data

所有行的Size全加起来,也能大概算出硬盘大小。

参考:

1. 百度百科双CPU中对超线程、双核心、双CPU的介绍:双CPU

2. CSDN博客:Linux下查看CPU信息[/proc/cpuinfo]

3. CSDN博客:处理器CPU概念及CPU多线程

4.博客园博客:Linux 查看系统硬件信息(实例详解)

Linux下查看系统配置 相关文章

  1. vsftpd实现基于SSL的FTPS

    目录 一、查看是否支持SS 二、创建自签名证书 三、配置vsftpd服务支持SSL 一、查看是否支持SS $ ldd `which vsftpd`$ ldd `which vsftpd`|grep libssllibssl.so.10 = /lib64/libssl.so.10 (0x00007f7bd8ea7000) 二、创建自签名证书 # CentOS 7 上可以实现直接

  2. 鸟哥的linux私房菜——第十八章学习(登录文件)

    第十八章、登录文件 1.1)、什么是登录文件及其配置 登录文件:记录系统活动信息的几个文件, 例如:何时、何地 (来源 IP)、何人 (什么服务名称)、做了什么动作 (讯息登录啰)。 换句话说就是:记录系统在什么时候由哪个程序做了什么样的行为时,发生了

  3. 鸟哥的linux私房菜——第十七章学习(系统服务)

    第十七章、系统服务 1.1)、daemon与service 系统为了某些功能必须要提供一些服务 (不论是系统本身还是网络方面),这个服务就称为 service 。 但是 service 的提供总是需要程序的运行吧!否则如何执行呢所以达成这个 service 的程序我们就称呼他为 daemon

  4. 鸟哥的linux私房菜——第十九章学习(Linux的开机流程分析)

    第十九章学习(Linux的开机流程分析) 1.1)、开机流程 简单来说,系统开机的经过可以汇整成下面的流程的: 1. 载入 BIOS 的硬件信息与进行自我测试,并依据设置取得第一个可开机的设备; 2. 读取并执行第一个开机设备内 MBR 的 boot Loader (亦即是 grub2,

  5. 进程间通信之——信号(一)

    关于linux信号的知识点,我找到一篇博客写的非常好:https://www.cnblogs.com/hoys/archive/2012/08/19/2646377.html 本篇博客主要是为了加深自己的理解,并且在上篇博客的基础上做一些扩充,有可能会有说的不对的地方。 具体与信号相关的资料可以用输入man

  6. nginx教程五,用GoAccess工具实时查看nginx日志

    一、安装GoAccess 推荐的官方安装方式https://www.vultr.com/docs/how-to-install-goaccess-on-centos-7 1. 更新系统 yum -y install epel-releaseyum -y updateshutdown -r now 2. 安装环境依赖,goaccess是C语言开发的,需要安装ncurses和gcc yum -y insta

  7. 操作系统并发的一些知识点梳理

    并发无论是在操作系统层面还是在编程语言层面,都是一个极为重要的概念。线程(thread)是对并发的一种抽象,经典观念认为一个程序只有一个执行点(一个程序计数器,用来指向要执行的指令)。但是多线程(multi-thread)程序会有多个执行点(多个程序计数器)。换个

  8. [Linux] 从外网访问内网硬盘

    目的 实现一个由nginx的文件访问系统,并且是用户加密验证的。 安装和配置nginx 安装 利用官方给出的地址,可以安装nginx. 开启的文件位于 /etc/init.d/nginx,请注意,这个和nginx官网介绍的路径不一样。 你可以使用下述命令,控制nginx的开启,等等: sudo

  9. linux中的strip命令简介

    转载:https://blog.csdn.net/qq_37858386/article/details/78559490 strip:去除,剥去 一、下面是man strip获得到的信息,简单的说就是给文件脱掉外衣,具体就是从特定文件中剥掉一些符号信息和调试信息,使文件变

  10. 关于rundll32

    简介 出于安全原因,系统管理员将添加组策略以实现限制本地用户的应用程序执行,此处将通过rundll32来实现绕过相关安全策略dll(动态链接库)文件对于windows系统非常重要,决定了自定义windows的其他程序的运行,向其他程序提供有关如何调用某些内容的指令

每天更新java,php,javaScript,go,python,nodejs,vue,android,mysql等相关技术教程,教程由网友分享而来,欢迎大家分享IT技术教程到本站,帮助自己同时也帮助他人!

Copyright 2020, All Rights Reserved. Powered by 跳墙网(www.tqwba.com)|网站地图|关键词