kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

lshw命令,查看系统信息

1
2
3
4
lshw -short

lshw -C system
lshw -C cpu

https://zhuanlan.zhihu.com/p/42403181


https://blog.csdn.net/phmatthaus/article/details/109443056

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
lshw 是一个能把我们出去硬件信息的小工具,它能为我们提供内存配置、固件版本、主板配置信息、CPU版本和速度、cache信息、总线速度等。它能运行在 DMI兼容的 x86、IA-64和一些 PowerPC的平台上。目前支持 DMI (x86 and IA-64 only), OpenFirmware device tree (PowerPC only), PCI/AGP, CPUID (x86), IDE/ATA/ATAPI, PCMCIA (only tested on x86), SCSI 和 USB。

参数:

-version       :显示 lshw的版本
-help          :显示帮助信息
-X             :启动图形界面
-html          :将设备信息以 html的格式输出
-xml           :将设备信息以 xml的格式输出
-json          :将设备信息以 json的格式输出
-short         :带有设置路径的简短输出(类似与 HP-UX的 ioscan输出形式)
-businfo       :输出详细的总线信息(包含 SCSI, USB, IDE and PCI地址)
-dump filename :将收集到的信息输出到一个SQLite数据库中
-class class   :仅仅显示指定类型的硬件,在使用 lshw -short or lshw -businfo时我们能见到这写 class,
                 常见的有这些:system、bus、memory、processor、bridge、display、communication、
                          multimedia、network、disk、volume、powoer
-C class       :等同与 -class class
-enable test   :启用测试,测试项能包含这些:
                 dmi (for DMI/SMBIOS extensions)
                 device-tree (for OpenFirmware device tree)
                 spd (for memory Serial Presence Detect)
                 memory (for memory-size guessing heuristics)
                 cpuinfo (for kernel-reported CPU  detection)
                 cpuid  (for  CPU  detection)
                 pci  (for  PCI/AGP access)
                 isapnp  (for ISA PnP extensions)
                 pcmcia (for PCMCIA/PCCARD)
                 ide (for IDE/ATAPI)
                 usb (for USB devices)
                 scsi (for SCSI)
                 network (for net‐work interfaces detection)
-disable test
-quiet         :不现实状态
-sanitize      :移除IP地址、序列号等敏感信息
-numeric       :显示 PCI和USB设备的数字 ID
它在运行的时候会都去下列文件:


/usr/local/share/pci.ids
/usr/share/pci.ids
/etc/pci.ids
/usr/share/hwdata/pci.ids  :A list of all known PCI ID's (vendors, devices, classes and subclasses).
/proc/bus/pci/*            :Used to access the configuration of installed PCI busses and devices.
/proc/ide/*                :Used to access the configuration of installed IDE busses and devices.
/proc/scsi/*, /dev/sg*     :Used to access the configuration of installed SCSI devices.
/dev/cpu/*/cpuid           :Used on x86 platforms to access CPU-specific configuration.
/proc/device-tree/*        :Used on PowerPC platforms to access OpenFirmware configuration.
/proc/bus/usb/*            :Used to access the configuration of installed USB busses and devices.
/sys/*                     :Used on 2.6 kernels to access hardware/driver configuration information.