Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Find the OS Version from the Command Line (Windows, Linux, CentOS)

Short commands that show your operating system and its version.

How-To Guides1 min read3 steps2 screenshots

On Windows

systeminfo

  1. Press Win + R, type cmd and press Enter.
    Opening Command Prompt
  2. Type:
systeminfo
  1. Look at OS Name and OS Version in the output. To show only these lines:
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

ver

ver

It prints the version number, for example Microsoft Windows [Version 10.0.19045.3693].

The ver command

On Linux

lsb_release

lsb_release -a

It lists the distributor, description, release and code name.

The os-release file

cat /etc/os-release

To show only the name:

grep PRETTY_NAME /etc/os-release

hostnamectl also shows the OS and the kernel:

hostnamectl

On CentOS

centos-release file

cat /etc/centos-release

rpm

rpm -q centos-release

redhat-release

cat /etc/redhat-release

On macOS

sw_vers

Quick recap

  • Windows: systeminfo or ver.
  • Linux: cat /etc/os-release or lsb_release -a.
  • CentOS: cat /etc/centos-release.