查看硬盘配置命令

本文介绍了如何在Linux系统中使用命令行工具来查看硬件配置,包括CPU的物理和逻辑核心数、内存大小、硬盘容量以及类型(固态或机械)。通过`cat /proc/cpuinfo`、`free -m`、`df -h`、`hdparm -i /dev/sda`等命令,可以获取到系统的详细硬件信息。
摘要由CSDN通过智能技术生成

Linux系统常用命令

Linux查看物理CPU个数、核数、逻辑CPU个数

说明:
CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数

查看CPU信息(型号)

lantiancheng@ubuntu1:~$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      8  Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz

查看物理CPU个数

lantiancheng@ubuntu1:~$ cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
1

查看每个物理CPU中core的个数(即核数)

lantiancheng@ubuntu1:~$ cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores       : 4

查看逻辑CPU的个数

lantiancheng@ubuntu1:~$ cat /proc/cpuinfo| grep "processor"| wc -l
8

从上面执行的结果来看,证明我使用的cpu有1*4=4核,每个核有2个超线程,所以有8个逻辑cpu。

查看内存大小

lantiancheng@ubuntu1:~$ cat /proc/meminfo | grep MemTotal
MemTotal:       16307696 kB //内存16G

查看内存条数

lantiancheng@ubuntu1:~$ sudo dmidecode |grep -A16 "Memory Device$"
[sudo] password for lantiancheng: 
Memory Device
        Array Handle: 0x0044
        Error Information Handle: Not Provided
        Total Width: Unknown
        Data Width: Unknown
        Size: No Module Installed
        Form Factor: DIMM
        Set: None
 
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值