Documente Academic
Documente Profesional
Documente Cultură
rev 1.0
# lscpi
or
# /sbin/lspci
# lspci v
# lspci -vv
$ lspci
pcilib: Resource 5 in /sys/bus/pci/devices/0000:00:1f.1/resource has a 64-bit address, ignoring
00:00.0 Host bridge: Intel Corporation E8500 Hub Interface 1.5 (rev 10)
00:01.0 PCI bridge: Intel Corporation E8500 PCI Express x4 Port D (rev 10)
00:02.0 PCI bridge: Intel Corporation E8500 PCI Express x4 Port C0 (rev 10)
00:03.0 PCI bridge: Intel Corporation E8500 PCI Express x4 Port C1 (rev 10)
00:04.0 PCI bridge: Intel Corporation E8500 PCI Express x4 Port B0 (rev 10)
00:05.0 PCI bridge: Intel Corporation E8500 PCI Express x4 Port B1 (rev 10)...
# lspci -v
02:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev 09) (prog-if 00
[Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=02, secondary=03, subordinate=06, sec-latency=64
Memory behind bridge: fd300000-fd3fffff
Capabilities: [44] Express PCI/PCI-X Bridge IRQ 0
Capabilities: [5c] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
Capabilities: [6c] Power Management version 2
Capabilities: [d8] PCI-X bridge device.
Capabilities: [100] Advanced Error Reporting
Capabilities: [300] Power Budgeting
lspcireads some information from the PCI bus, then displays additional
information from its own database of hardware IDs -- vendors, devices, classes
and subclasses -- at /usr/share/misc/pci.ids.
# update-pciids
$ dmesg | less
You can also filter the output of dmesg to find specific devices. For example, to list
all USB devices, use:
Here are what "real," not emulated, SCSI devices look like:
Note that these searches only return lines containing your search string. There is
often more information adjacent to these lines, which you'll find by eyeballing the
whole file:
Initializing CPU#0
Detected 801.446 MHz processor.
You want to monitor a running system in real time, and view things like physical
memory and CPU information, or identify drives.
Solution: Read the /proc virtual filesystem. Use only cat to read /proc, or utilities
designed expressly for it, such as sysctl, lspci, ps, and top. The syntax is the same
as for reading any file:
$ cat /proc/filename
You can explore /proc just like any filesystem and easily find the information you
want. Look to the named folders for hardware information:
$ ls /proc
bus cmdline cpuinfo devices dma driver filesystems ide kcore kmsg ksyms loadavg
meminfo misc modules mounts mtrr partitions pci scsi swaps sys tty
$ cat /proc/cpuinfo
processor :0
vendor_id : GenuineIntel
cpu family : 15
model :4
model name : Intel(R) Xeon(TM) MP CPU 3.66GHz
stepping :9
cpu MHz : 2333.450
cache size : 1024 KB
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
dts acpi mmx fxsr sse sse2 ss ht tm syscall lm pni monitor ds_cpl est tm2 cid cx16 xtpr ts
bogomips : 7225.34
clflush size : 64
cache_alignment : 128
address sizes : 40 bits physical, 48 bits virtual
power management:
...
$ cat /proc/meminfo
MemTotal: 16417964 kB
MemFree: 11121728 kB
Buffers: 209176 kB
Cached: 4172608 kB
SwapCached: 0 kB
Active: 2275904 kB
Inactive: 2843592 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 16417964 kB
LowFree: 11121728 kB
SwapTotal: 1020116 kB
SwapFree: 1020116 kB
...
$ cat /proc/ide/ide0/hda/geometry
physical 39870/16/63
logical 2501/255/63
To show SCSI devices, using the following command. Note that it does not
differentiate between devices attached to the SCSI bus and IDE devices using
the SCSI-emulation subsystem. These are IDE CD drives:
$ cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 03 Lun: 00
Vendor: HP Model: Ultrium 2-SCSI Rev: S53D
Type: Sequential-Access ANSI SCSI revision: 03
As mentioned earlier, to read /proc use only cat or utilities designed expressly for
it, such as sysctl, lspci, ps, and top. Pagers like less and more give a different picture,
because they re-read /proc with each page. And you don't want to use a text
editor, or any utility with write powers, because you can mess up a system in a
heartbeat.