This article is written to show how to do the thing specified in the title of this article. It is about how to check operating system name and also the version of it. In order to achieve the purpose or the goal, the exact or the suitable command is needed to be performed. It is actually a command performed in any terminal or any tool which is considered as text or command line interface. Any host, workstation or server which is running in a GUI (Graphical User Interface) or in a CLI (Command Line Interface) doesn’t matter at all. As long as the operating system has any command line interface in order execute a command for printing or showing the operating system name. Below is the command :
1. cat /etc/redhat-release
[user@hostname ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) [user@hostname ~]#
It is actually a command for printing or showing the content of the file. The commad cat itself is can be considered as an abbreviation for concatenate which also can be retrieved from the manual page. Precisely, it is concatenate files and print on the standard output which in the context of the above command execution, it is printed in the monitor. The above command, it is actually a command which can be executed in the Redhat Family operating system including CentOS, etc.
user@hostname:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial user@hostname:~$
The above command is actually a command which is executed in an operating system with the variant of Debian, Ubuntu and any of the derivations among the others. It can be retrieved from the manual page that the command lsb_release is to print the distribution-specific information. The additional parameter -a, it is actually an additional parameter to print or to display all of the information which can be presented or can be given.