Professional Documents
Culture Documents
Collect System Config
Collect System Config
tecmint@tecmint ~ $ uname
Linux
To view your network hostname, use -n switch with uname command as shown.
tecmint@tecmint ~ $ uname -n
tecmint.com
tecmint@tecmint ~ $ uname -v
#64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014
tecmint@tecmint ~ $ uname -r
uname -r
r
3.13.0-37-generic
tecmint@tecmint ~ $ uname -m
x86_64
All this information can be printed at once by running uname -a command as shown
below.
tecmint@tecmint ~ $ uname -a
Linux tecmint.com 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC
2014 x86_64 x86_64 x86_64 GNU/Linux
Here you can use the lshw tool to gather vast information about your hardware
components such as cpu, disks, memory, usb controllers etc.
lshw is a relatively small tool and there are few options that you can use with it while
extracting information. The information provided by lshw gathered form different /proc
files.
Note: Do remember that the lshw command executed by superuser (root) or sudo
user.
Read Also: Difference Between su and sudo User in Linux
To print information about your Linux system hardware, run this command.
You can print a summary of your hardware information by using the -short option.
If you wish to generate output as a html file, you can use the option -html.
tecmint@tecmint ~ $ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 69
Stepping: 1
CPU MHz: 768.000
BogoMIPS: 4788.72
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3
Block devices are storage devices such as hard disks, flash drives etc. lsblk command
is used to report information about block devices as follows.
tecmint@tecmint ~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
sda1 8:1 0 1000M 0 part
sda2 8:2 0 260M 0 part /boot/efi
sda3 8:3 0 1000M 0 part
sda4 8:4 0 128M 0 part
sda5 8:5 0 557.1G 0 part
sda6 8:6 0 25G 0 part
sda7 8:7 0 14.7G 0 part
sda8 8:8 0 1M 0 part
sda9 8:9 0 324.5G 0 part /
sda10 8:10 0 7.9G 0 part [SWAP]
sr0 11:0 1 1024M 0 rom
If you want to view all block devices on your system then include the -a option.
tecmint@tecmint ~ $ lsblk -a
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
sda1 8:1 0 1000M 0 part
sda2 8:2 0 260M 0 part /boot/efi
sda3 8:3 0 1000M 0 part
sda4 8:4 0 128M 0 part
sda5 8:5 0 557.1G 0 part
sda6 8:6 0 25G 0 part
sda7 8:7 0 14.7G 0 part
sda8 8:8 0 1M 0 part
sda9 8:9 0 324.5G 0 part /
sda10 8:10 0 7.9G 0 part [SWAP]
sdb 8:16 1 0 disk
sr0 11:0 1 1024M 0 rom
ram0 1:0 0 64M 0 disk
ram1 1:1 0 64M 0 disk
ram2 1:2 0 64M 0 disk
ram3 1:3 0 64M 0 disk
ram4 1:4 0 64M 0 disk
ram5 1:5 0 64M 0 disk
ram6 1:6 0 64M 0 disk
ram7 1:7 0 64M 0 disk
ram8 1:8 0 64M 0 disk
ram9 1:9 0 64M 0 disk
loop0 7:0 0 0 loop
loop1 7:1 0 0 loop
loop2 7:2 0 0 loop
loop3 7:3 0 0 loop
loop4 7:4 0 0 loop
loop5 7:5 0 0 loop
loop6 7:6 0 0 loop
loop7 7:7 0 0 loop
ram10 1:10 0 64M 0 disk
ram11 1:11 0 64M 0 disk
ram12 1:12 0 64M 0 disk
ram13 1:13 0 64M 0 disk
ram14 1:14 0 64M 0 disk
ram15 1:15 0 64M 0 disk
The lsusb command is used to report information about USB controllers and all the
devices that are connected to them.
tecmint@tecmint ~ $ lsusb
Bus 001 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp.
Bus 002 Device 004: ID 5986:0249 Acer, Inc
Bus 002 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card
Reader Controller
Bus 002 Device 002: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
You can use the -v option to generate a detailed information about each USB device.
tecmint@tecmint ~ $ lsusb -v
6. How to Print PCI Devices Information
PCI devices may included usb ports, graphics cards, network adapters etc. The lspci
tool is used to generate information concerning all PCI controllers on your system plus
the devices that are connected to them.
tecmint@tecmint ~ $ lspci
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated
Graphics Controller (rev 0b)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev
0b)
00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0
(rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller
(rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3
(rev e4)
00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4
(rev e4)
00:1c.4 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 5
(rev e4)
00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1
[AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe
Wireless Network Adapter
03:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 840M] (rev a2)
tecmint@tecmint ~ $ lspci -t
-[0000:00]-+-00.0
+-02.0
+-03.0
+-14.0
+-16.0
+-1b.0
+-1c.0-[01]----00.0
+-1c.3-[02]----00.0
+-1c.4-[03]----00.0
+-1d.0
+-1f.0
+-1f.2
\-1f.3
Use the -v option to produce detailed information about each connected device.
tecmint@tecmint ~ $ lspci -v
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
Subsystem: Lenovo Device 3978
Flags: bus master, fast devsel, latency 0
Capabilities:
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated
Graphics Controller (rev 0b) (prog-if 00 [VGA controller])
Subsystem: Lenovo Device 380d
Flags: bus master, fast devsel, latency 0, IRQ 62
Memory at c3000000 (64-bit, non-prefetchable) [size=4M]
Memory at d0000000 (64-bit, prefetchable) [size=256M]
I/O ports at 6000 [size=64]
Expansion ROM at [disabled]
Capabilities:
Kernel driver in use: i915
.....
To view all your scsi/sata devices, use the lsscsi command as follows. If you do not
have lsscsi tool installed, run the following command to install it.
tecmint@tecmint ~ $ lsscsi
[0:0:0:0] disk ATA ST1000LM024 HN-M 2BA3 /dev/sda
[1:0:0:0] cd/dvd PLDS DVD-RW DA8A5SH RL61 /dev/sr0
[4:0:0:0] disk Generic- xD/SD/M.S. 1.00 /dev/sdb
tecmint@tecmint ~ $ lsscsi -s
[0:0:0:0] disk ATA ST1000LM024 HN-M 2BA3 /dev/sda 1.00TB
[1:0:0:0] cd/dvd PLDS DVD-RW DA8A5SH RL61 /dev/sr0 -
[4:0:0:0] disk Generic- xD/SD/M.S. 1.00 /dev/sdb -
You can find some information about sata devices on your system as follows using the
hdparm utility. In the example below, I used the block device /dev/sda1 which the
harddisk on my system.
To print information about device geometry interms of cylinders, heads, sectors, size
and the starting offset of the device, use the -g option.
To gather information about file system partitions, you can use fdisk command.
Although the main functionality of fdisk command is to modify file system partitions, it
can also be used to view information about the different partitions on your file system.
You can print partition information as follows. Remember to run the command as a
superuser or else you may not see any output.
You can also use the dmidecode utility to extract hardware information by reading data
from the DMI tables.