Bash Command to Find OS Version in Terminal

In order to know what version of OS you are running, you can make use of the below commands on the Bash Terminal based on your operating system.


Debian/Ubuntu Linux:

# lsb_release -a 

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04

CentOS/RHEL Linux:

# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.9 (Maipo)

Other Linux/Unix-Like Systems:

# uname -a

Linux b9fc21f2fc40 5.15.49-linuxkit-pr #1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

macOS:

# uname -a

14.0
macOS Bash Shell Know OS Version Number Example

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!