Linux: Get System Info

By Xah Lee. Date: . Last updated: .

Find Linux Kernel Version

On a terminal, type

uname -a

linux terminal uname 2016-05-10
uname -a

Find 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.

Find CPU is 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 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

Find CPU model

2 ways.

Here's lscpu output:

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:    1
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 5
Model name:            AMD Athlon(tm) II X4 645 Processor
Stepping:              3
CPU MHz:               800.000
CPU max MHz:           3100.0000
CPU min MHz:           800.0000
BogoMIPS:              6199.70
Virtualization:        AMD-V
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
NUMA node0 CPU(s):     0-3
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
~/web/xahlee_info/linux $
# 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:

Find GPU Model

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)

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

Find USB Devices

# show usb devices
xinput
linux xinput output 2017 04 19

(2012-04-28 thanks to Aaron Coakley)

Linux Shell Basics

  1. Get System Info
  2. Shell Basics
  3. grep, cat, awk, uniq
  4. sort
  5. find, xargs
  6. diff Files/Dir
  7. dir size: du
  8. dir tree
  9. tar gzip bzip2 xz 7zip rar zip
  10. wget, curl, GET, HEAD
  11. rsync
  12. Install Packages

Sys Admin

  1. Job Control
  2. ps
  3. top
  4. htop
  5. RAM stat
  6. Users and Groups
  7. File Permission
  8. Opened Files: lsof
  9. shutdown, sleep

Bash/Terminal

  1. Bash Keys, Terminal Keys, Man Page Keys
  2. Bash Prompt Setup
  3. Bash Color Prompt
  4. .bashrc, .profile, .bash_profile
  5. Virtual Console
  6. Terminal Control Sequence Keys
  7. Reset Terminal
  8. tmux
  9. man page
  10. Bash Manual in Chapters
  11. BASH Shell Misc Tips
  12. Log Terminal Session

Linux Desktop

  1. Most Useful GUI Apps
  2. Set Default App
  3. Shell Commands for GUI Apps
  4. Image Viewers
  5. Music Players
  6. Move File to Trash by Command
  7. X11 Selection and Clipboard
  8. How to Switch to LXDE, Xfce
  9. LXDE Keyboard Shortcuts
  10. LXDE/Openbox, Change Keyboard Shortcuts
  11. LXDE Set Key Repeat Rate
  12. LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window
  13. Xfce Keyboard Shortcuts
  14. Xfce Good Themes
  15. xmonad Keybinding
  16. How to Restart X11
  17. Why Tiling Window Manager Sucks
  18. Standard Fonts
  19. How to Install Font

If you have a question, put $5 at patreon and message me.