Search Engine

Senin, 06 Juni 2011

Command Line untuk Menampilkan Informasi Hardware di Ubuntu

Terkadang kita lupa merk dan tipe hardware yang kita gunakan di komputer kita, padahal pada saat tersebut kita ingin memasang sebuah program aplikasi di system kita, dan aplikasi tersebut memiliki spesifikasi minimal hardware yang disyaratkan. Atau kondisi saat anda membeli komputer/notebook baru yang didalamnya sudah terinstall sistem operasilinux dan anda ingin melihat mencocokkan spesifikasi antara brosur yang diberikan penjual kepada anda dengan komputer/notebook yang berada dihadapan anda, mungkintips berikut bisa sangat membantu anda.
Untuk melihat hardware yang terpasang, pada terminal bisa digunakan perintah lshw, lspci, dan lsusb. Oleh karena itu buka dulu terminal anda.


1.  lshw dan lspci
numb@numb-ubuntu-10:~$ lspci
00:00.0 Host bridge: nVidia Corporation Device 07c3 (rev a2)
00:00.1 RAM memory: nVidia Corporation nForce 630i memory controller (rev a2)
00:01.0 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.1 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.2 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.3 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.4 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.5 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.6 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:02.0 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:03.0 ISA bridge: nVidia Corporation MCP73 LPC Bridge (rev a2)
00:03.1 SMBus: nVidia Corporation MCP73 SMBus (rev a1)
...
Perintah lshw dan lspci akan memberikan informasi hardware yang sangat panjang, untuk memperpendek output yang dikeluarkan bisa digabungkan dengan perintah grep. Contoh berikut akan menghasilkan informasi hardware ethernet
$ lspci | grep -i ethernet
numb@numb-ubuntu-10:~$ lspci | grep -i ethernet
00:0f.0 Ethernet controller: nVidia Corporation MCP73 Ethernet (rev a2)
Agar perintah lspci menampilkan informasi yang lebih mendetail, gunakan opsi lspci -v danlspci -vv perintah ini membutuhkan hak akses root, contoh :
$ sudo lspci -v
numb@numb-ubuntu-10:~$ sudo lspci -v
[sudo] password for numb:
00:00.0 Host bridge: nVidia Corporation Device 07c3 (rev a2)
Subsystem: Elitegroup Computer Systems Device 2145
Flags: bus master, 66MHz, fast devsel, latency 0
00:00.1 RAM memory: nVidia Corporation nForce 630i memory controller (rev a2)
Subsystem: Elitegroup Computer Systems Device 2145
Flags: bus master, 66MHz, fast devsel, latency 0
2. lsusb
Perintah ini digunakan untuk mengetahui hardware yagn menggunakan port USB, contoh :
$ lsusb -v
numb@numb-ubuntu-10:~$ lsusb -v
Bus 002 Device 002: ID 4851:1103
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               1.10
bDeviceClass          224 Wireless
bDeviceSubClass         1 Radio Frequency
bDeviceProtocol         1 Bluetooth
bMaxPacketSize0        64 
3. dmesg
Jika digabungkan dengan perintah grep peintah ini bisa kita gunakan untuk mencari informasi hardware tertentu saja, contoh berikut untuk mencari string USB
$ dmesg | grep -i usb
numb@numb-ubuntu-10:~$ dmesg | grep -i usb
[    0.220329] usbcore: registered new interface driver usbfs
[    0.220397] usbcore: registered new interface driver hub
[    0.220482] usbcore: registered new device driver usb
[    0.328123] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.328761] ehci_hcd 0000:00:04.1: new USB bus registered, assigned bus number 1
[    0.378058] ehci_hcd 0000:00:04.1: USB 2.0 started, EHCI 1.00
[    0.378325] usb usb1: configuration #1 chosen from 1 choice
[    0.378437] hub 1-0:1.0: USB hub found
[    0.378627] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.379299] ohci_hcd 0000:00:04.0: new USB bus registered, assigned bus number 2
[    0.468356] usb usb2: configuration #1 chosen from 1 choice
[    0.468438] hub 2-0:1.0: USB hub found
[    0.468608] uhci_hcd: USB Universal Host Controller Interface driver
[ 2389.708052] usb 2-5: new full speed USB device using ohci_hcd and address 2
[ 2389.977081] usb 2-5: configuration #1 chosen from 1 choice
[ 2390.052236] Bluetooth: Generic Bluetooth USB driver ver 0.6
[ 2390.055926] usbcore: registered new interface driver btusb
mencari string hd
$ dmesg | grep -i hd
numb@numb-ubuntu-10:~$ dmesg | grep -i hd
[    0.000000] ACPI: NVHD 7ffae0c0 00554 (v01 070708  NVHDCP  20080707 MSFT 00000097)
[    1.328936] forcedeth 0000:00:0f.0: highdma pwrctl mgmt gbit lnktim msi desc-v3
[   11.123493] HDA Intel 0000:00:09.0: power state changed by ACPI to D0
[   11.123526] HDA Intel 0000:00:09.0: power state changed by ACPI to D0
[   11.123905] HDA Intel 0000:00:09.0: PCI INT A -> Link[LAZA] -> GSI 23 (level, low) -> IRQ 23
[   11.123908] hda_intel: Disable MSI for Nvidia chipset
[   11.123954] HDA Intel 0000:00:09.0: setting latency timer to 64
4. Selain perintah-perintah diatas kita bisa mengetahui informasi hardware dengan melihat directori /proc lebih lengkap anda bisa melihat tulisan saya disini berikut contoh melihat isi directory /proc menggunakan perintah cat
$ cat /proc/cpuinfo
numb@numb-ubuntu-10:~$ cat /proc/cpuinfo
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Pentium(R) Dual  CPU  E2200  @ 2.20GHz
stepping    : 13
cpu MHz        : 1203.000
cache size    : 1024 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
.... 
$ cat /proc/meminfo
numb@numb-ubuntu-10:~$ cat /proc/meminfo
MemTotal:        2061204 kB
MemFree:         1072808 kB
Buffers:           95060 kB
Cached:           410616 kB
SwapCached:            0 kB
Active:           493292 kB
Inactive:         392876 kB
.....
5. Perintah lain yang bisa anda gunakan, adalah perintah fdisk untuk melihat informasi mengenai harddisk dan partisi yang ada di dalamnya, contoh
$ sudo fdisk -l
numb@numb-ubuntu-10:~$ sudo fdisk -l
[sudo] password for numb:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0e182c2f
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       10198    81915403+   7  HPFS/NTFS
/dev/sda2           10199       60802   406471094+   f  W95 Ext'd (LBA)
/dev/sda5           10199       54817   358402086    7  HPFS/NTFS
/dev/sda6           54818       55304     3905536   82  Linux swap / Solaris
/dev/sda7           55304       60802    44162048   83  Linux 
Dan masih banyak lagi command line yang bisa digunakan untuk melihat informasi hardware, agar kita bisa sharing, anda bisa berbagi command line yang biasa anda pakai pada kotak komentar di bawah. Selamat mencoba

Sumber : Terkadang kita lupa merk dan tipe hardware yang kita gunakan di komputer kita, padahal pada saat tersebut kita ingin memasang sebuah program aplikasi di system kita, dan aplikasi tersebut memiliki spesifikasi minimal hardware yang disyaratkan. Atau kondisi saat anda membeli komputer/notebook baru yang didalamnya sudah terinstall sistem operasilinux dan anda ingin melihat mencocokkan spesifikasi antara brosur yang diberikan penjual kepada anda dengan komputer/notebook yang berada dihadapan anda, mungkintips berikut bisa sangat membantu anda.
Untuk melihat hardware yang terpasang, pada terminal bisa digunakan perintah lshw, lspci, dan lsusb. Oleh karena itu buka dulu terminal anda.
1.  lshw dan lspci
numb@numb-ubuntu-10:~$ lspci
00:00.0 Host bridge: nVidia Corporation Device 07c3 (rev a2)
00:00.1 RAM memory: nVidia Corporation nForce 630i memory controller (rev a2)
00:01.0 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.1 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.2 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.3 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.4 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.5 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:01.6 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:02.0 RAM memory: nVidia Corporation nForce 630i memory controller (rev a1)
00:03.0 ISA bridge: nVidia Corporation MCP73 LPC Bridge (rev a2)
00:03.1 SMBus: nVidia Corporation MCP73 SMBus (rev a1)
...
Perintah lshw dan lspci akan memberikan informasi hardware yang sangat panjang, untuk memperpendek output yang dikeluarkan bisa digabungkan dengan perintah grep. Contoh berikut akan menghasilkan informasi hardware ethernet
$ lspci | grep -i ethernet
numb@numb-ubuntu-10:~$ lspci | grep -i ethernet
00:0f.0 Ethernet controller: nVidia Corporation MCP73 Ethernet (rev a2)
Agar perintah lspci menampilkan informasi yang lebih mendetail, gunakan opsi lspci -v danlspci -vv perintah ini membutuhkan hak akses root, contoh :
$ sudo lspci -v
numb@numb-ubuntu-10:~$ sudo lspci -v
[sudo] password for numb:
00:00.0 Host bridge: nVidia Corporation Device 07c3 (rev a2)
Subsystem: Elitegroup Computer Systems Device 2145
Flags: bus master, 66MHz, fast devsel, latency 0
00:00.1 RAM memory: nVidia Corporation nForce 630i memory controller (rev a2)
Subsystem: Elitegroup Computer Systems Device 2145
Flags: bus master, 66MHz, fast devsel, latency 0
2. lsusb
Perintah ini digunakan untuk mengetahui hardware yagn menggunakan port USB, contoh :
$ lsusb -v
numb@numb-ubuntu-10:~$ lsusb -v
Bus 002 Device 002: ID 4851:1103
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               1.10
bDeviceClass          224 Wireless
bDeviceSubClass         1 Radio Frequency
bDeviceProtocol         1 Bluetooth
bMaxPacketSize0        64 
3. dmesg
Jika digabungkan dengan perintah grep peintah ini bisa kita gunakan untuk mencari informasi hardware tertentu saja, contoh berikut untuk mencari string USB
$ dmesg | grep -i usb
numb@numb-ubuntu-10:~$ dmesg | grep -i usb
[    0.220329] usbcore: registered new interface driver usbfs
[    0.220397] usbcore: registered new interface driver hub
[    0.220482] usbcore: registered new device driver usb
[    0.328123] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.328761] ehci_hcd 0000:00:04.1: new USB bus registered, assigned bus number 1
[    0.378058] ehci_hcd 0000:00:04.1: USB 2.0 started, EHCI 1.00
[    0.378325] usb usb1: configuration #1 chosen from 1 choice
[    0.378437] hub 1-0:1.0: USB hub found
[    0.378627] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.379299] ohci_hcd 0000:00:04.0: new USB bus registered, assigned bus number 2
[    0.468356] usb usb2: configuration #1 chosen from 1 choice
[    0.468438] hub 2-0:1.0: USB hub found
[    0.468608] uhci_hcd: USB Universal Host Controller Interface driver
[ 2389.708052] usb 2-5: new full speed USB device using ohci_hcd and address 2
[ 2389.977081] usb 2-5: configuration #1 chosen from 1 choice
[ 2390.052236] Bluetooth: Generic Bluetooth USB driver ver 0.6
[ 2390.055926] usbcore: registered new interface driver btusb
mencari string hd
$ dmesg | grep -i hd
numb@numb-ubuntu-10:~$ dmesg | grep -i hd
[    0.000000] ACPI: NVHD 7ffae0c0 00554 (v01 070708  NVHDCP  20080707 MSFT 00000097)
[    1.328936] forcedeth 0000:00:0f.0: highdma pwrctl mgmt gbit lnktim msi desc-v3
[   11.123493] HDA Intel 0000:00:09.0: power state changed by ACPI to D0
[   11.123526] HDA Intel 0000:00:09.0: power state changed by ACPI to D0
[   11.123905] HDA Intel 0000:00:09.0: PCI INT A -> Link[LAZA] -> GSI 23 (level, low) -> IRQ 23
[   11.123908] hda_intel: Disable MSI for Nvidia chipset
[   11.123954] HDA Intel 0000:00:09.0: setting latency timer to 64
4. Selain perintah-perintah diatas kita bisa mengetahui informasi hardware dengan melihat directori /proc lebih lengkap anda bisa melihat tulisan saya disini berikut contoh melihat isi directory /proc menggunakan perintah cat
$ cat /proc/cpuinfo
numb@numb-ubuntu-10:~$ cat /proc/cpuinfo
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Pentium(R) Dual  CPU  E2200  @ 2.20GHz
stepping    : 13
cpu MHz        : 1203.000
cache size    : 1024 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
.... 
$ cat /proc/meminfo
numb@numb-ubuntu-10:~$ cat /proc/meminfo
MemTotal:        2061204 kB
MemFree:         1072808 kB
Buffers:           95060 kB
Cached:           410616 kB
SwapCached:            0 kB
Active:           493292 kB
Inactive:         392876 kB
.....
5. Perintah lain yang bisa anda gunakan, adalah perintah fdisk untuk melihat informasi mengenai harddisk dan partisi yang ada di dalamnya, contoh
$ sudo fdisk -l
numb@numb-ubuntu-10:~$ sudo fdisk -l
[sudo] password for numb:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0e182c2f
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       10198    81915403+   7  HPFS/NTFS
/dev/sda2           10199       60802   406471094+   f  W95 Ext'd (LBA)
/dev/sda5           10199       54817   358402086    7  HPFS/NTFS
/dev/sda6           54818       55304     3905536   82  Linux swap / Solaris
/dev/sda7           55304       60802    44162048   83  Linux 
Dan masih banyak lagi command line yang bisa digunakan untuk melihat informasi hardware, agar kita bisa sharing, anda bisa berbagi command line yang biasa anda pakai pada kotak komentar di bawah. Selamat mencoba

Tidak ada komentar:

Posting Komentar