Comando lshw

Tecnologia infraestrutura e desenvolvimento

Comando lshw

Comando lshw

Bom, quando queremos saber qual o Hardware noso equipamento tem para Windows usamos AIDA, EVEREST entre outros e no Linux como saber seu hardware, versão de Kernel, Barramentos entre outras informações, esse artigo vai mostrar tudo isso OK.

Usando o Terminal para Informação do Sistema

# lshw –help
Hardware Lister (lshw) – B.02.16
uso: lshw [-format] [-options …]
       lshw -version

    -version imprime a versão do programa (B.02.16)

formato pode ser
    -html           gera saída de árvore de hardware como HTML
    -xml            gera saída de árvore de hardware como XML
    -short          gera saída dos caminhos de hardware
    -businfo        gera saída de informações de barramento

opções podem ser
    -class CLASS    mostra somente uma classe de hardware
    -C CLASS        o mesmo que ‘-class CLASS’
    -c CLASS        o mesmo que ‘-class CLASS’
    -disable TESTE  desativa um teste (como pci, isapnp, cpuid, etc. )
    -enable TESTE    ativa um teste (como pci, isapnp, cpuid, etc. )
    -quiet          não exibe o status
    -sanitize       sanear saída (remove informações confidenciais como números de série, etc.)
    -numeric        gera saída de IDs numéricas (para PCI, USB, etc.)

# lshw -short
Caminho do hardware  Dispositivo  Classe         Descrição
============================================================
                                  system         Vostro 3550 (To be filled by O.E.M.)
/0                                bus            0326FG
/0/4                              processor      Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
/0/4/5                            memory         64KiB L1 cache
/0/4/6                            memory         512KiB L2 cache
/0/4/7                            memory         3MiB L3 cache
/0/1d                             memory         4GiB Memória do sistema
/0/1d/0                           memory         DIMMProject-Id-Version: lshwReport-Msgid-Bugs-To: FULL NAME POT-Creation-Date: 2
/0/1d/1                           memory         4GiB SODIMM DDR3 Síncrono 1333 MHz (0,8 ns)
/0/0                              memory         64KiB BIOS
/0/100                            bridge         2nd Generation Core Processor Family DRAM Controller
/0/100/1                          bridge         Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
/0/100/1/0                        display        Whistler [Radeon HD 6630M/6650M/6750M/7670M/7690M]
/0/100/2                          display        2nd Generation Core Processor Family Integrated Graphics Controller
/0/100/16                         communication  6 Series/C200 Series Chipset Family MEI Controller #1
/0/100/1a                         bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
/0/100/1b                         multimedia     6 Series/C200 Series Chipset Family High Definition Audio Controller
/0/100/1c                         bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 1
/0/100/1c.1                       bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 2
/0/100/1c.1/0        eth0         network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/1c.3                       bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 4
/0/100/1c.3/0        wlan0        network        AR9285 Wireless Network Adapter (PCI-Express)
/0/100/1c.4                       bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 5
/0/100/1c.4/0                     bus            uPD720200 USB 3.0 Host Controller
/0/100/1c.7                       bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 8
/0/100/1d                         bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
/0/100/1f                         bridge         HM67 Express Chipset Family LPC Controller
/0/100/1f.2                       storage        6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller
/0/100/1f.3                       bus            6 Series/C200 Series Chipset Family SMBus Controller
/0/1                 scsi0        storage        
/0/1/0.0.0           /dev/sda     disk           500GB ST9500423AS
/0/1/0.0.0/1         /dev/sda1    volume         100MiB Windows NTFS volume
/0/1/0.0.0/2         /dev/sda2    volume         38GiB Windows NTFS volume
/0/1/0.0.0/3         /dev/sda3    volume         380GiB Windows NTFS volume
/0/1/0.0.0/4         /dev/sda4    volume         45GiB Extended partition
/0/1/0.0.0/4/5       /dev/sda5    volume         2114MiB Linux swap / Solaris partition
/0/1/0.0.0/4/6       /dev/sda6    volume         43GiB Linux filesystem partition
/0/2                 scsi4        storage        
/0/2/0.0.0           /dev/cdrom   disk           DVDRWBD CT30N
/1                                power          DELL YXVK212

Suponhamos que você queira saber uma CLASSE em especial por exemplo a classe DISK então executariamos o comando abaixo:

# lshw -class disk
  *-disk                  
       descrição: ATA Disk
       produto: ST9500423AS
       fabricante: Seagate
       ID físico: 0.0.0
       informações do barramento: scsi@0:0.0.0
       nome lógico: /dev/sda
       versão: 0001
       serial: 5WS27LXQ
       tamanho: 465GiB (500GB)
       capacidades: partitioned partitioned:dos
       configuração: ansiversion=5 sectorsize=4096 signature=b436f045
  *-cdrom
       descrição: DVD-RAM writer
       produto: DVDRWBD CT30N
       fabricante: HL-DT-ST
       ID físico: 0.0.0
       informações do barramento: scsi@4:0.0.0
       nome lógico: /dev/cdrom
       nome lógico: /dev/sr0
       versão: A201
       capacidades: removable audio cd-r cd-rw dvd dvd-r dvd-ram
       configuração: ansiversion=5 status=nodisc

Gera a saída de informações de barramento

# lshw -businfo
Informações do barramento  Dispositivo  Classe         Descrição
====================================================================
                                          system         Vostro 3550 (To be filled by O.E.M.)
                                          bus            0326FG
cpu@0                                     processor      Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
                                          memory         64KiB L1 cache
                                          memory         512KiB L2 cache
                                          memory         3MiB L3 cache
                                          memory         4GiB Memória do sistema
                                          memory         DIMMProject-Id-Version: lshwReport-Msgid-Bugs-To: FULL NAME POT-Creation
                                          memory         4GiB SODIMM DDR3 Síncrono 1333 MHz (0,8 ns)
                                          memory         64KiB BIOS
pci@0000:00:00.0                          bridge         2nd Generation Core Processor Family DRAM Controller
pci@0000:00:01.0                          bridge         Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
pci@0000:01:00.0                          display        Whistler [Radeon HD 6630M/6650M/6750M/7670M/7690M]
pci@0000:00:02.0                          display        2nd Generation Core Processor Family Integrated Graphics Controller
pci@0000:00:16.0                          communication  6 Series/C200 Series Chipset Family MEI Controller #1
pci@0000:00:1a.0                          bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
pci@0000:00:1b.0                          multimedia     6 Series/C200 Series Chipset Family High Definition Audio Controller
pci@0000:00:1c.0                          bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 1
pci@0000:00:1c.1                          bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 2
pci@0000:05:00.0             eth0         network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
pci@0000:00:1c.3                          bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 4
pci@0000:09:00.0             wlan0        network        AR9285 Wireless Network Adapter (PCI-Express)
pci@0000:00:1c.4                          bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 5
pci@0000:0b:00.0                          bus            uPD720200 USB 3.0 Host Controller
pci@0000:00:1c.7                          bridge         6 Series/C200 Series Chipset Family PCI Express Root Port 8
pci@0000:00:1d.0                          bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
pci@0000:00:1f.0                          bridge         HM67 Express Chipset Family LPC Controller
pci@0000:00:1f.2                          storage        6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller
pci@0000:00:1f.3                          bus            6 Series/C200 Series Chipset Family SMBus Controller
                             scsi0        storage        
scsi@0:0.0.0                 /dev/sda     disk           500GB ST9500423AS
scsi@0:0.0.0,1               /dev/sda1    volume         100MiB Windows NTFS volume
scsi@0:0.0.0,2               /dev/sda2    volume         38GiB Windows NTFS volume
scsi@0:0.0.0,3               /dev/sda3    volume         380GiB Windows NTFS volume
scsi@0:0.0.0,4               /dev/sda4    volume         45GiB Extended partition
                             /dev/sda5    volume         2114MiB Linux swap / Solaris partition
                             /dev/sda6    volume         43GiB Linux filesystem partition
                             scsi4        storage        
scsi@4:0.0.0                 /dev/cdrom   disk           DVDRWBD CT30N
                                          power          DELL YXVK212

Gerar relatorio total do Hardware em um arquivo HMTL

# lshw -html > /tmp/Hardware.html

id:notedejano
descrição:Computador portatil
produto:Vostro 3550 (To be filled by O.E.M.)
fabricante:Dell Inc.
versão:Not Specified
serial:7SDN6S1
largura:64 bits
capacidades:smbios-2.6 dmi-2.6 vsyscall32
configuração:boot = normal chassis = portable sku = To be filled by O.E.M. uuid = 44454C4C-5300-1044-804E-B7C04F365331
id:core
descrição:Placa-mãe
produto:0326FG
fabricante:Dell Inc.
ID fisico:0
versão:A07
serial:.7SDN6S1.BR1081919Q000Q.
slot:To Be Filled By O.E.M.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *