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


# uname -a

macOS Bash Shell Know OS Version Number Example

Facing issues? Have Questions? Post them here! I am happy to answer!

Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap