Find Linux version you are running using the command line

Julio Franco

Posts: 8,856   +1,790
TechSpot Elite
As you probably know, there are many distributions and variants of Linux out there, to name a few: Ubuntu, Arch Linux, Fedora, CentOS, openSUSE, Linux Mint, Elementary OS, Tails. It can be useful to know what OS version and distro you are running for patching and security purposes.

Using the Linux terminal, use one of the following commands which will provide a different set of information:
  • cat /etc/os-release
  • cat /proc/version
  • hostnamectl


Another common means is
which also works in Mac terminal and Windows Cygwin environments

On OS X however uname will always report Darwin.

A better command is sw_vers and it will show the OS X Version
Last edited by a moderator: