It’s not always easy to look for your Linux distribution name and version. Sometimes you will need those information because you are asked, for example on a support forum to resolve your problems.
There are a few simple and useful commands that will help you for this.
Distribution name and version
This command will be helpful to find the distribution name and it’s version like Debian X, Fedora X, Ubuntu X, etc.
1 2 3 4 5 6 7 |
user:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 6.0.7 (squeeze) Release: 6.0.7 Codename: squeeze |
Kernel version
If you want to find your Linux kernel version, use this command
1 2 3 |
user:~$ uname -r 3.2.13-grsec-xxxx-grs-ipv6-64 |
To cut and keep only the version number in your custom script, you could use this:
1 2 3 |
user:~$ uname -r|cut -d\- -f1 3.2.13 |
CPU details
If you need information about your microprocessor. With this command you’re going to have details for each CPU core.
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 26 27 28 |
user:~$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 42 model name : Intel(R) Core(TM) i5-2300 CPU @ 2.80GHz stepping : 7 microcode : 0x6 cpu MHz : 2801.000 cache size : 6144 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 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 lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid bogomips : 5587.42 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: etc. |
Memory information
If you need to display details about your memory hardware, use this
1 2 3 4 5 6 7 8 |
user:~$ cat /proc/meminfo MemTotal: 16338592 kB MemFree: 708108 kB Buffers: 608384 kB Cached: 13089324 kB SwapCached: 0 kB etc. |
Hard Drive information
To display HDD specifications, use this command
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 |
root:~$ hdparm -I /dev/sda /dev/sda: ATA device, with non-removable media Model Number: ST32000641AS Serial Number: 9WM48LKC Firmware Revision: CC13 Transport: Serial Standards: Used: unknown (minor revision code 0x0029) Supported: 8 7 6 5 Likely used: 8 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 3907029168 Logical/Physical Sector size: 512 bytes device size with M = 1024*1024: 1907729 MBytes device size with M = 1000*1000: 2000398 MBytes (2000 GB) |
To check and display free space remaining
1 2 3 4 5 6 7 8 |
user:~$ df -h FileSystem Size Used. Avai. Used% mounted on /dev/sda1 49G 9,2G 37G 20% / tmpfs 7,8G 0 7,8G 0% /lib/init/rw udev 10M 216K 9,8M 3% /dev tmpfs 7,8G 0 7,8G 0% /dev/shm /dev/sda2 1,8T 27G 1,7T 2% /home |
Network information
You can display network settings only in root permissions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
root:~$ ifconfig eth0 Link encap:Ethernet HWaddr e0:69:X:72:93:7b inet adr:91.121.9.X Bcast:91.121.9.X Masque:255.255.255.0 adr inet6: fe80:X:fe72:937b/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:310385488 errors:0 dropped:0 overruns:0 frame:0 TX packets:335509463 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 RX bytes:85952449914 (80.0 GiB) TX bytes:291546858370 (271.5 GiB) Interruption:20 Mémoire:fe500000-fe520000 lo Link encap:Boucle locale inet adr:127.0.0.1 Masque:255.0.0.0 adr inet6: ::1/128 Scope:Hôte UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:143822669 errors:0 dropped:0 overruns:0 frame:0 TX packets:143822669 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:0 RX bytes:199551576590 (185.8 GiB) TX bytes:199551576590 (185.8 GiB) |
PCI Bus information
lspci is a command that prints detailed information about all PCI buses and devices in the system.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
user:~$ lspci 00:00.0 Host bridge: Intel Corporation Sandy Bridge DRAM Controller (rev 09) 00:02.0 VGA compatible controller: Intel Corporation Sandy Bridge Integrated Graphics Controller (rev 09) 00:16.0 Communication controller: Intel Corporation Cougar Point HECI Controller #1 (rev 04) 00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05) 00:1a.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #2 (rev 05) 00:1c.0 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 1 (rev b5) 00:1c.3 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 4 (rev b5) 00:1d.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #1 (rev 05) 00:1f.0 ISA bridge: Intel Corporation Cougar Point LPC Controller (rev 05) 00:1f.2 SATA controller: Intel Corporation Cougar Point 6 port SATA AHCI Controller (rev 05) 00:1f.3 SMBus: Intel Corporation Cougar Point SMBus Controller (rev 05) 01:00.0 PCI bridge: Integrated Technology Express, Inc. Device 8892 (rev 10) 03:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03) |
Recent Comments