西数超哥博客
运维经验教程分享的博客

linux常用命令大全

linux下常用命令大全,做个记录方便自己后期使用
1、lspci命令,查看服务器当前pci设备的信息,比如主板、显卡、网卡、硬盘等,若找不到命令,请运行 yum install pciutils -y 安装

  1. [root@ebs-57916 ~]# lspci
  2. 00:00.0 Host bridge: Intel Corporation 440FX – 82441FX PMC [Natoma] (rev 02)
  3. 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
  4. 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
  5. 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
  6. 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
  7. 00:02.0 VGA compatible controller: Cirrus Logic GD 5446
  8. 00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
  9. 00:04.0 Ethernet controller: Red Hat, Inc Virtio network device
  10. 00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
  11. 00:06.0 SCSI storage controller: Red Hat, Inc Virtio block device
  12. 00:07.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
[root@ebs-57916 ~]# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
00:04.0 Ethernet controller: Red Hat, Inc Virtio network device
00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
00:06.0 SCSI storage controller: Red Hat, Inc Virtio block device
00:07.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon

2、查看CPU

物理CPU个数: cat /proc/cpuinfo |grep “physical id”|sort |uniq|wc -l
每个CPU物理核数: cat /proc/cpuinfo |grep “cpu cores”|uniq
每个CPU逻辑核数: cat /proc/cpuinfo |grep “siblings”|uniq
总CPU逻辑核数: cat /proc/cpuinfo |grep -c “processor”
我的服务器是两个芯片组,每个芯片组是10核,支持超线程,所以逻辑CPU是40。
超线程指物理内核+逻辑内核,芯片上只存在一个物理内核,但是这个物理内核可以模拟出一个逻辑内核,于是系统信息就显示了两个内核,一真一假

  1. [root@ebs-57916 ~]# cat /proc/cpuinfo |grep “physical id”|sort |uniq|wc -l
  2. 4
  3. [root@ebs-57916 ~]# cat /proc/cpuinfo |grep “cpu cores”|uniq
  4. cpu cores : 1
  5. [root@ebs-57916 ~]# cat /proc/cpuinfo |grep “siblings”|uniq
  6. siblings : 1
  7. [root@ebs-57916 ~]# cat /proc/cpuinfo |grep -c “processor”
  8. 4
[root@ebs-57916 ~]# cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
4
[root@ebs-57916 ~]# cat /proc/cpuinfo |grep "cpu cores"|uniq
cpu cores	: 1
[root@ebs-57916 ~]# cat /proc/cpuinfo |grep "siblings"|uniq
siblings	: 1
[root@ebs-57916 ~]# cat /proc/cpuinfo |grep -c "processor"
4

 

赞(0) 打赏
声明:本站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,若涉及侵权请及时告知,将会在第一时间删除。本站原创内容未经允许不得转载:西数超哥 » linux常用命令大全

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏