Ways to Check Linux OS Version in Command Line

Looked it up out of curiosity

Checking Linux Kernel version

: The Linux Kernel version is managed in /proc/version

$ cat /proc/version
Linux version 3.10.0-957.21.3.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Tue Jun 18 16:35:19 UTC 2019

Checking the current kernel version

  • Use the -a option for detailed information

$ uname -r
3.10.0-957.21.3.el7.x86_64

$ uname -a
Linux 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Checking Linux Distro version

: The method for checking the distro version differs for each distro

CentOS / RedHat Enterprise

Ubuntu

Debian

Fedora

Last updated