How to view device information about your hardware on linux
How to view device information about your hardware on linux
Some of us will want to view the hardware information in a system without really taking the system apart and checking each component at a time. On linux you normally have a lot of options, normally structured based on exactly the things you need.
For instance, you wish to get the information from your computer CPU, this is really easily done via command:
1 |
cat /proc/cpuinfo |
This will give you a nice little output with each CPU core information, similar to:
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 |
processor : 3 vendor_id : GenuineIntel cpu family : 6 model : 58 model name : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz stepping : 9 microcode : 0x12 cpu MHz : 1600.000 cache size : 6144 KB physical id : 0 siblings : 4 core id : 3 cpu cores : 4 apicid : 6 initial apicid : 6 fpu : yes fpu_exception : yes cpuid level : 13 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 pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms bogomips : 6799.77 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: |
In the above example I included only the last CPU core information, but all others have similar info.
The next one would the memory usage information. This one is a bit tricky, most users do not understand that the values here are usually with buffered/cached values included.
The command for this is:
1 |
free -m |
The output would be similar to:
1 2 3 4 |
total used free shared buffers cached Mem: 15987 5644 10342 0 415 2466 -/+ buffers/cache: 2762 13224 Swap: 0 0 0 |
In a unix based OS you normally do not know, but you are using almost all your ram constantly. However the difference here is that most of it is used as buffered/cached ram. The actual ram I’m using at the moment 5644MB, and 2762MB is being cached.
To see how much disk space usage you currently have you can use:
1 |
fdisk -l |
The output of the command (you run it as *root*) is:
1 2 3 4 5 6 7 8 9 |
Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00056ee2 Device Boot Start End Blocks Id System /dev/sda1 63 234439534 117219736 83 Linux |
You can also see the aproximate usage of each mount point by using command:
1 |
df -h |
This will similar to:
1 2 3 4 5 6 |
Filesystem Size Used Avail Use% Mounted on /dev/sda1 111G 82G 23G 79% / udev 7.8G 4.0K 7.8G 1% /dev tmpfs 3.2G 1.2M 3.2G 1% /run none 5.0M 0 5.0M 0% /run/lock none 7.9G 2.1M 7.9G 1% /run/shm |
To list all your PCI devices you just need to run the command:
1 |
lspci |
The same would be for USB devices:
1 |
lsusb |
These would get you similar output as bellow:
1 2 3 4 5 6 7 8 9 10 |
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 003 Device 002: ID 09da:9090 A4 Tech Co., Ltd XL-750BK Laser Mouse Bus 001 Device 003: ID 04f9:01ea Brother Industries, Ltd DCP-7030 Bus 001 Device 004: ID 05ac:1006 Apple, Inc. Hub in Aluminum Keyboard Bus 001 Device 005: ID 05ac:0250 Apple, Inc. |
I hope this article helped someone, I was thinking last night that I wanted to get some information about my laptop and thought I should write about this.