Just open the os-release file
It is nice to know to see the OS version installed in one’s linux machine. This might come in handy to check the version installed in a running docker container or other virtual machines.
To check the OS version and configs, just run the following command:
1 | $ cat /etc/os-release |
This should output something like:
1 | NAME="Pop!_OS" |
Since I have a System76 Galago Pro, I see the above configuration.
The information you see always depends on your machine’s manufacturer. However, the properties are same across linux distributions.
Others:
1. lsb_release command
The lsb_release command gives LSB (Linux Standard Base) and distribution-specific information on the CLI. The usage is:
1 | $ lsb_release -a |
outputs something like:
1 | No LSB modules are available. |
As I chose the Ubuntu flavoured System76 Pop!_OS, I do not have any LSB modules to be shown.
2. hostnamectl command
Use hostnamectl command to query and change the system hostname and related settings. Just type the following command to check OS name and Linux kernel version:
1 | $ hostnamectl status |
or just
1 | $ hostnamectl |
outputs something like:
1 | Static hostname: pop-os |
3. uname command
Just print Linux kernel version, run:
1 | $ uname -r |
to see all available options:
1 | $ uname -a |