《k8s权威指南学习》--Service
7z
ab
accept
ack
ag
alias
apachectl
apk
apropos
apt-get
apt-key
apt-sortpkgs
aptitude
ar
arch
arj
arp
arpd
arping
arptables
arpwatch
as
ASCII码表
at
atop
atq
atrm
awk
axel
badblocks
base64
basename
batch
bc
bg
bind
blkid
blockdev
bmodinfo
break
builtin
bunzip2
bye
bzcat
bzcmp
bzdiff
bzgrep
bzip2
bzip2recover
bzless
bzmore
cal
Calico容器网络
cancel
cat
cd
cdrecord
centos检测新的硬盘
CentOS调整磁盘大小【磁盘空间移动】
cgroup
chage
chattr
chcon
chfn
chgrp
chkconfig
chmod
chown
chpasswd
chroot
chsh
cksum
clear
clock
clockdiff
cmp
col
colrm
comm
command
compress
conntrack相关字段
consoletype
continue
convertquota
cp
cpio
crontab
csplit
cu
cupsdisable
cupsenable
curl
cut
date
dc
dd
declare
depmod
df
dhclient
dhcpd
dhcrelay
diff
diff3
diffstat
dig
dircolors
dirname
dirs
disown
dmesg
dmidecode
dnf
dnsdomainname
domainname
dos2unix
dpkg
dpkg-deb
dpkg-divert
dpkg-preconfigure
dpkg-query
dpkg-reconfigure
dpkg-split
dpkg-statoverride
dpkg-trigger
dris
dstat
du
dump
e2fsck
e2label
eBPF_cilium
eBPF入门
echo
ed
edquota
egrep
eject
elinks
elm
emacs
enable
env
ethtool
ex
exec
exit
expand
export
exportfs
expr
false
fc
fdisk
fg
fgrep
file
find
findfs
finger
firewall-cmd
fishshell
fmt
fold
fping
free
fsck
ftp
ftpcount
ftpshut
ftptop
ftpwho
fuser
gcc
gcov
gdb
get_module
getenforce
getsebool
git
gpasswd
gpm
grep
groupadd
groupdel
groupmems
groupmod
groups
grpck
grpconv
grpunconv
grub
grub2-mkconfig
grub2-set-default
gunzip
gzexe
gzip
halt
hdparm
head
help
hexdump
history
host
hostid
hostname
hostnamectl
hping3
htdigest
htop
htpasswd
hwclock
hypervisor
iconv
id
ifcfg
ifconfig
ifconfig配置命令
ifdown
ifstat
iftop
ifup
indent
info
init
inotifywait
insmod
install
Internet和internet
iostat
iotop
ip
ip link
ip6tables
ip6tables-restore
ip6tables-save
ipcalc
ipcrm
ipcs
iperf
iptables
iptables-restore
iptables-save
iptables的数据包的流程介绍
iptables详解
iptraf
iptstate
ispell
jed
jobs
joe
join
journalctl
jq
jwhois
k8s downward API
k8s网络
kernelversion
kexec
kill
kill 命令的用途
killall
last
lastb
lastlog
ld
ldconfig
ldd
less
let
lftp
lftpget
lha
lilo
linux cat
linux cron表达式
linux tmp文件
linux_lldptool
linux修改系统语言
linux日志轮转
linux用户态与内核态
linux自动化交互工具:expect示例
ln
lnstat
local
locate
logger
login
logname
logout
logrotate
logsave
logwatch
look
losetup
lp
lpadmin
lpc
lpq
lpr
lprm
lpstat
ls
lsattr
lsb_release
lsblk
lscpu
lsmod
lsof
lspci
lsusb
ltrace
lvcreate
lvdisplay
lvextend
lvreduce
lvremove
lvresize
lvscan
lynx
mail
mailq
mailstat
make
man
mapfile
md5sum
mesg
mii-tool
mkbootdisk
mkcert
mkdir
mke2fs
mkfs
mkinitrd
mkisofs
mknod
mkswap
mktemp
modprobe
more
mount
mpstat
mtools
mv
mysql
mysqladmin
mysqldump
mysqlimport
mysqlshow
named-checkzone
nano
nc
ncftp
neofetch
nethogs
netstat
newusers
nfsstat
ngrep
nice
nisdomainname
nl
nm
nmap
nmcli
nohup
nologin
nproc
nslookup
ntpdate
ntsysv
objdump
od
openssl
parted
partprobe
passwd
paste
patch
pathchk
perl
pfctl
pgrep
php
pico
pidof
pidstat
pigz
ping
pkill
pmap
popd
poweroff
ppp-off
pr
printf
protoize
ps
pssh
pstack
pstree
pushd
pv
pvchange
pvck
pvcreate
pvdisplay
pvremove
pvs
pvscan
pwck
pwconv
pwd
pwunconv
python setup.py编写参考
quota
quotacheck
quotaoff
quotaon
rcconf
rcp
read
readelf
readonly
reboot
reject
rename
renice
repquota
resize
restore
restorecon
return
rev
rexec
rlogin
rm
rmdir
rmmod
route
rpm
rpm2cpio
rpmbuild
rpmdb
rpmquery
rpmsign
rpmverify
rsh
rsync
runlevel
sar
scp
screen
script
scriptreplay
sed
sed替换命令收集
seinfo
semanage
sendmail
seq
service
sesearch
set
setfacl
setpci
setsebool
setsid
sftp
sftp-server
sh
shell中=和~的用法
shift
shopt
showmount
shuf
shutdown
skill
slabtop
sleep
slocate
smbclient
smbpasswd
SNAT和DNAT
sort
source
speedtest-cli
spell
split
squid
squidclient
ss
ssh
ssh-add
ssh-agent
ssh-copy-id
ssh-keygen
ssh-keyscan
sshd
startx
stat
strace
strings
stty
su
sudo
sum
supervisord
suspend
swapoff
swapon
sync
sysctl
syslog
systemctl
systool
tac
tail
tailf
talk
tar
tcpdump
tcpdump参数
tcpreplay
tee
telinit
telnet
tempfile
test
tftp
time
timedatectl
times
tload
tmux
top
touch
tput
tr
tracepath
traceroute
trap
tree
true
tty
type
ulimit
umask
umount
unalias
uname
unarj
uncompress
unexpand
uniq
unlink
unprotoize
unrar
unset
unzip
updatedb
uptime
useradd
userdel
usermod
usernetctl
users
uucico
uupick
uuto
vdfuse
vgchange
vgconvert
vgcreate
vgdisplay
vgextend
vgreduce
vgremove
vgrename
vgscan
vi
vim常用的一些命令记录
vmstat
volname
w
wait
wall
watch
wc
wget
whatis
whereis
which
who
whoami
write
xargs
xauth
xclip
xhost
xinit
xlsatoms
xlsclients
xlsfonts
xrandr
xset
xz
yes
ypdomainname
yum
zcat
zfore
zip
zipinfo
zipsplit
znew
主机通过dhcp获取ip的过程
二层交换机和三层交换机区别
修改Centos官方云镜像的root密码
修改rpm包
如何解决虚拟机断电重启后进入紧急模式的问题
容器化和kvm的区别
建立一个名为agetest的账号,该账号第一次登陆后使用默认密码,但必须更改密码后使用新密码才能够登陆系统使用bash环境
收藏专题
查看POD的IP地址
网卡的混杂模式
解压缩
输入输出定向
2024-08-08    2024-08-08    1859 字  4 分钟

dmidecode

在Linux系统下获取有关硬件方面的信息

补充说明

dmidecode命令 可以让你在Linux系统下获取有关硬件方面的信息。dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。dmidecode遵循SMBIOS/DMI标准,其输出的信息包括BIOS、系统、主板、处理器、内存、缓存等等。

DMI(Desktop Management Interface,DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force(DMTF)起草的开放性的技术标准,其中DMI设计适用于任何的平台和操作系统。

DMI充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了电脑厂商和用户对系统的了解。DMI的主要组成部分是Management Information Format(MIF)数据库。这个数据库包括了所有有关电脑系统和配件的信息。通过DMI,用户可以获取序列号、电脑厂商、串口信息以及其它系统配件信息。

语法

1
dmidecode [选项]

选项

1
2
3
4
5
6
7
8
-d:(default:/dev/mem)从设备文件读取信息,输出内容与不加参数标准输出相同。
-h:显示帮助信息。
-s:只显示指定DMI字符串的信息。(string)
-t:只显示指定条目的信息。(type)
-u:显示未解码的原始条目内容。
--dump-bin file:将DMI数据转储到一个二进制文件中。
--from-dump FILE:从一个二进制文件读取DMI数据。
-V:显示版本信息。

dmidecode参数string及type列表:

(1)Valid string keywords are:

  • bios-vendor
  • bios-version
  • bios-release-date
  • system-manufacturer
  • system-product-name
  • system-version
  • system-serial-number
  • system-uuid
  • baseboard-manufacturer
  • baseboard-product-name
  • baseboard-version
  • baseboard-serial-number
  • baseboard-asset-tag
  • chassis-manufacturer
  • chassis-type
  • chassis-version
  • chassis-serial-number
  • chassis-asset-tag
  • processor-family
  • processor-manufacturer
  • processor-version
  • processor-frequency

(2)Valid type keywords are:

  • bios
  • system
  • baseboard
  • chassis
  • processor
  • memory
  • Cache
  • connector
  • slot

(3)type全部编码列表:

  • BIOS
  • System
  • Base Board
  • Chassis
  • Processor
  • Memory Controller
  • Memory Module
  • Cache
  • Port Connector
  • System Slots
  • On Board Devices
  • OEM Strings
  • System Configuration Options
  • BIOS Language
  • Group Associations
  • System Event Log
  • Physical Memory Array
  • Memory Device
  • 32-bit Memory Error
  • Memory Array Mapped Address
  • Memory Device Mapped Address
  • Built-in Pointing Device
  • Portable Battery
  • System Reset
  • Hardware Security
  • System Power Controls
  • Voltage Probe
  • Cooling Device
  • Temperature Probe
  • Electrical Current Probe
  • Out-of-band Remote Access
  • Boot Integrity Services
  • System Boot
  • 64-bit Memory Error
  • Management Device
  • Management Device Component
  • Management Device Threshold Data
  • Memory Channel
  • IPMI Device
  • Power Supply
  • Additional Information
  • Onboard Device

实例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
dmidecode -t 1  # 查看服务器信息
dmidecode | grep 'Product Name' # 查看服务器型号 
dmidecode |grep 'Serial Number' # 查看主板的序列号 
dmidecode -t 2  # 查看主板信息
dmidecode -s system-serial-number # 查看系统序列号 
dmidecode -t memory # 查看内存信息 
dmidecode -t 11 # 查看OEM信息 
dmidecode -t 17 # 查看内存条数
dmidecode -t 16 # 查询内存信息
dmidecode -t 4  # 查看CPU信息

cat /proc/scsi/scsi # 查看服务器硬盘信息

不带选项执行dmidecode命令通常会输出所有的硬件信息。dmidecode命令有个很有用的选项-t,可以按指定类型输出相关信息,假如要获得处理器方面的信息,则可以执行:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[root@localhost ~]# dmidecode -t processor
# dmidecode 2.11
SMBIOS 2.5 present.

Handle 0x0001, DMI type 4, 40 bytes
Processor Information
        Socket Designation: Node 1 Socket 1
        Type: Central Processor
        Family: Xeon MP
        Manufacturer: Intel(R) Corporation
        id: C2 06 02 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 44, Stepping 2
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                ss (Self-snoop)
                HTT (Multi-threading)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
        Voltage: 1.2 V
        External Clock: 5866 MHz
        Max Speed: 4400 MHz
        Current Speed: 2400 MHz
        Status: Populated, Enabled
        Upgrade: ZIF Socket
        L1 Cache Handle: 0x0002
        L2 Cache Handle: 0x0003
        L3 Cache Handle: 0x0004
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Core Count: 4
        Core Enabled: 4
        Thread Count: 8
        Characteristics:
                64-bit capable

Handle 0x0055, DMI type 4, 40 bytes
Processor Information
        Socket Designation: Node 1 Socket 2
        Type: Central Processor
        Family: Xeon MP
        Manufacturer: Not Specified
        ID: 00 00 00 00 00 00 00 00
        Signature: Type 0, Family 0, Model 0, Stepping 0
        Flags: None
        Version: Not Specified
        Voltage: 1.2 V
        External Clock: 5866 MHz
        Max Speed: 4400 MHz
        Current Speed: Unknown
        Status: Unpopulated
        Upgrade: ZIF Socket
        L1 Cache Handle: Not Provided
        L2 Cache Handle: Not Provided
        L3 Cache Handle: Not Provided
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Characteristics: None

查看内存的插槽数,已经使用多少插槽。每条内存多大,已使用内存多大

1
2
3
4
5
6
dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range 

#   Size: 2048 MB
#   Size: 2048 MB
#   Size: 4096 MB
#   Size: No Module Installed

查看内存支持的最大内存容量

1
2
3
dmidecode|grep -P 'Maximum\s+Capacity'

#  Maximum Capacity: 16 GB

查看内存的频率

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
dmidecode|grep -A16 "Memory Device"

#   Memory Device
#     Array Handle: 0x1000
#     Error Information Handle: Not Provided
#     Total Width: 72 bits
#     Data Width: 64 bits
#     Size: 2048 MB
#     Form Factor: DIMM
#     Set: 1
#     Locator: DIMM_A1
#     Bank Locator: Not Specified
#     Type: DDR3
#     Type Detail: Synchronous Unbuffered (Unregistered)
#     Speed: 1333 MHz
#     Manufacturer: 00CE000080CE
#     Serial Number: 4830F3E1
#     Asset Tag: 01093200
#     Part Number: M391B5673EH1-CH9
#   --
#   Memory Device
#     Array Handle: 0x1000
#     Error Information Handle: Not Provided
#     Total Width: 72 bits
#     Data Width: 64 bits
#     Size: 2048 MB
#     Form Factor: DIMM
#     Set: 1
#     Locator: DIMM_A2
#     Bank Locator: Not Specified
#     Type: DDR3
#     Type Detail: Synchronous Unbuffered (Unregistered)
#     Speed: 1333 MHz
#     Manufacturer: 00AD000080AD
#     Serial Number: 1BA1F0B5
#     Asset Tag: 01110900
#     Part Number: HMT325U7BFR8C-H9
#   --

dmidecode|grep -A16 "Memory Device"|grep 'Speed'

#  Speed: 1333 MHz
#  Speed: 1333 MHz
#  Speed: 1333 MHz
#  Speed: Unknown

```shell