How to Find OS Version with Command Line?

As soon as you plan to upgrade some software or buy a new one, you need to be aware of your operating system’s version. If you want your device to work properly, it is important to be aware of this information.

Your OS version can be found by a number of methods, depending on how you want to find it. It is possible to make use of a variety of command line utilities in order to accomplish this.

If you want to use the CMD commands, there are quite a few to choose from. It is possible to display the version of the Operating System by using a Ver command, for example.

As you will see, you can use the systeminfo command to find out more about your computer’s service pack, edition, build number, etc.

What is Command Line?

An interface that can be navigated by typing commands at prompts rather than using the mouse is the command line, which is also known as the Windows command line, the command screen, or the text interface.

For example, in Windows command lines, the Windows folder is usually written as “C:/Windows>” (as seen in the picture below). According to the shell used on the Unix or Linux system, this might be either “%” or”>”.

An operating system with a command line interface (command line) is quite different from an operating system that uses a graphical user interface (GUI) because it uses a keyboard for navigation, not a mouse.

What is an OS version?

Pressing the Windows logo key plus R, typing winver in the Open box, and then clicking OK will allow you to find out which version of Windows your device is running. Click the Start button and select Settings > System > About from the list of options available. 

Find OS version with Command Line for Windows

windows os

CMD can be used to find Windows 10 version and Service Pack number that can be found in the Control Panel. According to what we mentioned earlier, the “ver” command displays help in locating the version of Windows 10.

The following command should be typed at the Command Prompt in the Windows Operating System: 

The service pack number, however, is not the only important information that you need to know. You usually need to know other items as well.

  • Step 1: Run dialog box
  • Step 2: Go to command prompt

Find OS version with Command Line for Linux

linux os
  • Step 1: Open the terminal application

It is possible to check the Linux version by using the terminal application (Linux bash shell) in the terminal application.

ssh user@server-name
  • Step 2: Type the below commands 

You can use any of the commands listed below to see how to determine the Linux version and name by using one of the commands listed below:

cat /etc/os-releaselsb_release –ahostnamectl
name –r

Find OS version with Command Line for CentOS

CentOS
  • Step 1: Using cat-release commands

CentOS and Ubuntu can also be used to execute the previously explained commands. 

It is possible to open the release file of the Linux version distro and the major release version you have installed on your side using the following command if you are looking to check them.

cat /ets/os-release

The output for the command to check the Linux version will reveal the name of your operating system when you run the command to check the Linux version.

The latest version of the software will also be revealed, as well as other specifications such as the major version of the software.

cat /etc/centos-release
  • Step 2: Using hostnamectl command

There are also other commands that can be used for the Linux version of the command line, such as “hostnamectl” instead of the other commands.

This shows information from the “/etc/centos-release” file, the “uname -a” file, as well as other information gathered from these files. Additionally, it shows you which version of the Linux kernel your system is running along with the version number.

hostnamectl

Find OS version with Command Line for Ubuntu

Ubuntu os

When you use the terminal to check the version of Ubuntu, there are two methods you can use. A simple command needs to be entered into the command line in order for them to work.

Option 1: Command lsb_release -a

  • You can open the terminal by clicking on “”Show Applications”” or using the keyboard shortcut [Ctrl] + [Alt] + [T].
  • In the command line, type the command “lsb_release -a” and then press enter to execute the command.
  • “Description” and “Release” on the terminal show you the Ubuntu version that you are currently running.

Option 2: Read the contents of /etc/lsb-release

  • If you are using a Mac, you can open the terminal by selecting “Show Applications” or by using the keyboard shortcut [Ctrl] + [Alt] + [T].
  • The command to execute is “cat /etc/lsb-release”, and you need to press the enter key after typing it.
  • Under “DISTRIB_RELEASE” and “DISTRIB_DESCRIPTION”, your terminal shows you the version of Ubuntu you are running.

Best OS for a low-end PC

There are many kinds of computers that can run Ubuntu, and it is an OS that can run on them all. Most computers can run several versions, which are available in several languages. It is, however, advisable to know which version you are using before using it regularly in order to get the best results.

Conclusion

Having learned how to determine the type of Linux operating system you are running, you now know how to do it. In addition to these methods, there are a few other ways to figure out the type of OS, but these have been the most effective and convenient methods so far.

Basically, all of the methods above have been tried by many people and have proven to be very useful. It is important that you know that we have provided all the necessary information which will assist you in your search. In the future, when you face such problems, we hope that our method will be able to help you more effectively.

Share this:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.