linux下systool命令实战

  • linux下systool命令实战已关闭评论
  • 1,177 views
  • A+
所属分类:未分类

安装

centos7最小安装下默认是没有systool命令的,这时,我们就需要安装systool命令,首先,查找这个命令在哪个安装包,如下:

yum provides */systool

 

结果如下:

[root@xubo ~]# yum provides */systool
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.aliyun.com
sysfsutils-2.1.0-16.el7.x86_64 : Utilities for interfacing with sysfs
源 :base
匹配来源:
文件名 :/usr/bin/systool

说明是在sysfsutils这个包中,然后我们安装一下,命令如下:

yum install sysfsutils

这样就安装上了。

参数实例

实例一

直接运行systool,命令如下:

systool

结果如下:

[root@xubo ~]# systool
Supported sysfs buses:
 ac97
 acpi
 clocksource
 cpu
 event_source
 hid
 i2c
 machinecheck
 mdio_bus
 memory
 node
 pci
 pci_express
 platform
 pnp
 scsi
 serio
 usb
 usb-serial
 workqueue
 xen
Supported sysfs classes:
 ata_device
 ata_link
 ata_port
 backlight
 bdi
 block
 bsg
 cpuid
 dma
 dmi
 drm
 graphics
 hidraw
 hwmon
 i2c-adapter
 input
 leds
 mdio_bus
 mem
 misc
 msr
 net
 pci_bus
 pcmcia_socket
 power_supply
 raw
 rtc
 scsi_device
 scsi_disk
 scsi_generic
 scsi_host
 sound
 spi_host
 spi_transport
 thermal
 tty
 usbmon
 vc
 vtconsole
 watchdog
Supported sysfs devices:
 LNXSYSTM:00
 breakpoint
 cpu
 pci0000:00
 platform
 pnp0
 software
 system
 tracepoint
 virtual
Supported sysfs modules:
 8250
 ablk_helper
 ac97_bus
 acpi
 acpiphp
 aesni_intel
 ata_generic
 ata_piix
 battery
 block
 bridge
 cdrom
 configfs
 cpuidle
 crc32_pclmul
 crc32c_intel
 crc_t10dif
 crct10dif_common
 crct10dif_pclmul
 cryptd
 debug_core
 dm_log
 dm_mirror
 dm_mod
 dm_region_hash
 drm
 dynamic_debug
 e1000
 ebtable_broute
 ebtable_filter
 ebtable_nat
 ebtables
 efi_pstore
 efivars
 ehci_hcd
 firmware_class
 gf128mul
 ghash_clmulni_intel
 glue_helper
 hid
 hid_apple
 hid_magicmouse
 hid_ntrig
 i2c_core
 i2c_piix4
 i8042
 intel_idle
 ip6_tables
 ip6t_REJECT
 ip6t_rpfilter
 ip6table_filter
 ip6table_mangle
 ip6table_nat
 ip6table_raw
 ip6table_security
 ip_tables
 ipt_REJECT
 iptable_filter
 iptable_mangle
 iptable_nat
 iptable_raw
 iptable_security
 ipv6
 kdb_main
 kernel
 keyboard
 kgdboc
 kgdbts
 libata
 libcrc32c
 llc
 lrw
 md_mod
 module
 mousedev
 mperf
 mptbase
 mptscsih
 mptspi
 netpoll
 nf_conntrack
 nf_conntrack_ipv4
 nf_conntrack_ipv6
 nf_defrag_ipv4
 nf_defrag_ipv6
 nf_nat
 nf_nat_ipv4
 nf_nat_ipv6
 pata_acpi
 pci_hotplug
 pci_slot
 pcie_aspm
 pciehp
 pcmcia_core
 pcspkr
 printk
 processor
 psmouse
 pstore
 random
 rcupdate
 rcutree
 scsi_dh_alua
 scsi_dh_rdac
 scsi_mod
 scsi_transport_spi
 sd_mod
 serio_raw
 sg
 shpchp
 snd
 snd_ac97_codec
 snd_ens1371
 snd_page_alloc
 snd_pcm
 snd_rawmidi
 snd_seq
 snd_seq_device
 snd_timer
 soundcore
 spurious
 sr_mod
 stp
 sysrq
 tcp_cubic
 thermal
 tpm
 tpm_tis
 ttm
 uhci_hcd
 usbcore
 usbhid
 vmw_balloon
 vmw_vmci
 vmwgfx
 vt
 workqueue
 xfs
 xhci_hcd
 xt_conntrack
 xz_dec
 zswap

这里几乎所有的信息块都列出来了

实例二

查看某一个模块的信息,我们到上面列出的信息块中挑一个,比如cpuid,则命令如下:

systool -av -c cpuid

结果如下:

[root@xubo ~]# systool -av -c cpuid
Class = "cpuid"

Class Device = "cpu0"
 Class Device path = "/sys/devices/virtual/cpuid/cpu0"
 dev = "203:0"
 uevent = "MAJOR=203
MINOR=0
DEVNAME=cpu/0/cpuid"

Class Device = "cpu1"
 Class Device path = "/sys/devices/virtual/cpuid/cpu1"
 dev = "203:1"
 uevent = "MAJOR=203
MINOR=1
DEVNAME=cpu/1/cpuid"

Class Device = "cpu2"
 Class Device path = "/sys/devices/virtual/cpuid/cpu2"
 dev = "203:2"
 uevent = "MAJOR=203
MINOR=2
DEVNAME=cpu/2/cpuid"

Class Device = "cpu3"
 Class Device path = "/sys/devices/virtual/cpuid/cpu3"
 dev = "203:3"
 uevent = "MAJOR=203
MINOR=3
DEVNAME=cpu/3/cpuid"

 

其他的类似,就不一一说了

 

 

  • 安卓客户端下载
  • 微信扫一扫
  • weinxin
  • 微信公众号
  • 微信公众号扫一扫
  • weinxin
avatar