Home > System Tutorial > LINUX > body text

How to check the system version in linux

下次还敢
Release: 2024-04-11 22:57:16
Original
1054 people have browsed it

There are three ways to view the system version in Linux: Use the uname -r command to display only the kernel version. Read the /etc/os-release file to obtain the version number and release information. Use the lsb_release -a command to get information about a Linux distribution, including the version number.

How to check the system version in linux

How to check the Linux system version

In the Linux system, the method to check the system version is very simple.

1. Use the uname command

uname command is one of the most commonly used commands to view system information. To view the system version, you can use the following syntax:

<code>uname -r</code>
Copy after login

This command will only display the kernel version as follows:

<code>4.15.0-112-generic</code>
Copy after login

2. Use /etc/os- release File

/etc/os-release The file contains various information about the Linux distribution, including the version number. To view the system version, you can use the following command:

<code>cat /etc/os-release</code>
Copy after login

This command will display output similar to the following:

<code>PRETTY_NAME="Ubuntu 20.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="20.04"
VERSION="20.04.4 LTS (Focal Fossa)"
VERSION_CODENAME=focal</code>
Copy after login

3. Use the lsb_release command

lsb_release command is designed to display information about Linux distributions. To view the system version, you can use the following syntax:

<code>lsb_release -a</code>
Copy after login

This command will display output similar to the following:

<code>Distributor ID:    Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:    20.04
Codename:    focal</code>
Copy after login

The above is the detailed content of How to check the system version in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!