Linux: Get System Info

By Xah Lee. Date: . Last updated: .

How to find Linux kernel version?

On a terminal, type

uname -a

linux terminal uname 2016-05-10
uname -a

How to find the Linux distro name and version?

cat /etc/lsb-release

~ $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"

See also: man lsb_release. “lsb” stands for Linux Standard Base. Some distro do not support this.

How to find 32 bits or 64 bits?

# show linux is 32 bits or 64 bits
getconf LONG_BIT

This will tell you if your linux is 32 bits or 64 bits.

How to find out how much RAM installed?

# show how much RAM installed
cat /proc/meminfo
MemTotal:        5937800 kB
MemFree:         3344824 kB
Buffers:          579436 kB
Cached:          1130528 kB
SwapCached:            0 kB
Active:          1540120 kB
Inactive:         850112 kB
Active(anon):     607436 kB
Inactive(anon):    79140 kB
Active(file):     932684 kB
Inactive(file):   770972 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:       5115592 kB
HighFree:        3278656 kB
LowTotal:         822208 kB
LowFree:           66168 kB
SwapTotal:       6027260 kB
SwapFree:        6027260 kB
Dirty:                72 kB
Writeback:             0 kB
AnonPages:        680272 kB
Mapped:           105856 kB
Shmem:              6304 kB
Slab:             149900 kB
SReclaimable:      67808 kB
SUnreclaim:        82092 kB
KernelStack:        3168 kB
PageTables:         7636 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     8996160 kB
Committed_AS:    2692872 kB
VmallocTotal:     122880 kB
VmallocUsed:       17248 kB
VmallocChunk:      65456 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        8184 kB
DirectMap2M:      905216 kB

How to find CPU info?

# show CPU info
cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 5
model name      : AMD Athlon(tm) II X4 645 Processor
stepping        : 3
cpu MHz         : 3098.061
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 fxsr_opt 3dnowext 3dnow up extd_apicid pni monitor cr8_legacy
bogomips        : 6196.12
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management:

How to find what GPU i have?

Type

lspci -v

and look for VGA or ATI or NVIDIA.

The “lspci” command lists all PCI devices.

sample output

◆ lspci

00:00.0 Host bridge: Advanced Micro Devices [AMD] RS880 Host Bridge
00:01.0 PCI bridge: Advanced Micro Devices [AMD] RS780/RS880 PCI to PCI bridge (int gfx)
00:0a.0 PCI bridge: Advanced Micro Devices [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 5)
00:11.0 SATA controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]
00:12.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.1 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0 USB OHCI1 Controller
00:12.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.1 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0 USB OHCI1 Controller
00:13.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices [AMD] nee ATI SBx00 SMBus Controller (rev 3c)
00:14.2 Audio device: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel HDA)
00:14.3 ISA bridge: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 LPC host controller
00:14.4 PCI bridge: Advanced Micro Devices [AMD] nee ATI SBx00 PCI to PCI Bridge
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor HyperTransport Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Miscellaneous Control
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control
01:05.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI RS880 [Radeon HD 4200]
01:05.1 Audio device: Advanced Micro Devices [AMD] nee ATI RS880 HDMI Audio [Radeon HD 4200 Series]
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)

How to find your disk size and free space?

# show disk size and free space
df -H

The “-H” is for human readable in metric unit. (k = 10^3, M = 10^6, G = 10^9.)

df -H

Filesystem      Size  Used Avail Use% Mounted on
udev            3.0G     0  3.0G   0% /dev
tmpfs           600M  9.2M  591M   2% /run
/dev/sda5       465G  141G  301G  32% /
tmpfs           3.0G  415M  2.6G  14% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
tmpfs           3.0G     0  3.0G   0% /sys/fs/cgroup
cgmfs           103k     0  103k   0% /run/cgmanager/fs
tmpfs           600M   41k  600M   1% /run/user/1000

How to find usb devices?

# show usb devices
xinput
linux xinput output 2017 04 19

( thanks to Aaron Coakley)