请关注本头条号,每天坚持更新原创干货技术文章。
如需学习视频,请在微信搜索公众号“智传网优”直接开始自助视频学习。
1. dmesg命令简介
本文主要介绍在Linux系统上如何使用dmesg工具集查看服务器硬件信息。dmesg命令是Linux上查询硬件信息的常用工具之一。
安装dmesg工具,以CentOS为例:
[root@zcwyou ~]# yum -y install util-linux
2. 查看硬件的详细信息
命令:
[root@zcwyou ~]# dmesg |more
部分输出结果如下:
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.10.0-862.11.6.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Tue Aug 14 21:49:04 UTC 2018
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-862.11.6.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_U
S.UTF-8
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009dfff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000cf378fff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000cf379000-0x00000000cf38efff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000cf38f000-0x00000000cf3cdfff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x00000000cf3ce000-0x00000000cfffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000efffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fe000000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000082fffffff] usable
[ 0.000000] NX (Execute Disable) protection: active
linux使用dmesg查看硬件的详细信息
3. 查看前面15行信息
命令:
[root@zcwyou ~]# dmesg |head -15
输出结果:
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initia