There are several ways to find out which version of Linux you are running at the command line. Here are a few options:
Use the lsb_release
command: This command displays information about the Linux distribution, including the version and codename. To use it, simply type lsb_release -a
at the command prompt.
Use the uname
command: This command displays information about the Linux kernel, including the version. To display the kernel version, use the -r
option: uname -r
.
Check the /etc/os-release
file: This file contains information about the Linux distribution, including the version and codename. To view the contents of the file, use the cat
command: cat /etc/os-release
.
Check the /etc/redhat-release
file (for Red Hat-based distributions): This file contains information about the Red Hat-based distribution, including the version. To view the contents of the file, use the cat
command: cat /etc/redhat-release
.
Check the /etc/lsb-release
file (for Ubuntu and other Debian-based distributions): This file contains information about the Ubuntu or Debian-based distribution, including the version. To view the contents of the file, use the cat
command: cat /etc/lsb-release
.
By using one of these methods, you should be able to find out which version of Linux you are running at the command line.