Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Linux check the version

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to check the version of Linux, the content of the article is of high quality, so Xiaobian shares it with you as a reference, I hope you have a certain understanding of relevant knowledge after reading this article.

When we log on to Linux for the first time, it's best to check the version of Linux running on your computer before doing any work. For example, determining a good Linux distribution will help us determine which package manager to use to install new packages.

When people refer to Linux, they usually mean Linux distributions. Strictly speaking, Linux is a kernel, the core component of an operating system that simply places behavior on the bridge between software applications and hardware. A Linux distribution is an operating system consisting of the Linux kernel, GNU tools and libraries, and software collections. Typically, a Linux distribution consists of a desktop environment, a package management system, and a set of preinstalled applications.

Some of the most popular Linux distributions are Debian, Red Hat, Ubuntu, Arch Linux, Fedora, CentOS, Kali Linux, OpenSUSE, Linux Mint, and others.

How to check Linux version?

There are several different commands that help us determine which Linux distribution and kernel version is running on our system.

lsb_release command

The lsb_release application displays LSB (Linux Standard Library) information about Linux distributions; this lsb_release command applies to all Linux distributions where the lsb-release package is installed:

lsb_release -a

Output:

No LSB modules are available.Distributor ID:DebianDescription:Debian GNU/Linux 9.5 (stretch)Release:9.5Codename:stretch

Linux distributions and versions are shown in the Description line. As you can see from the output above, I have Debian GNU / Linux 9.5 (stretch) installed on my system.

We can also use the-d option to display only the "Description" line instead of outputting all of the above information.

lsb_release -d

Output something similar to:

Description:Debian GNU/Linux 9.5 (stretch)

If you get "command not found:lsb_release," you can try to identify the Linux version using some of the other methods below.

/ etc / os-release file

The/ etc / os-release file contains operating system identification data, including information about distribution. This file is part of systemd and should be available on linux systems running systemd.

To view the contents of the os-release file, run the following cat command:

cat /etc/os-release

The output is as follows:

PRETTY_NAME="Debian GNU/Linux 9 (stretch)"NAME="Debian GNU/Linux"VERSION_ID="9"VERSION="9 (stretch)"ID=debianHOME_URL="https://www.debian.org/"SUPPORT_URL="https://www.debian.org/support"BUG_REPORT_URL="https://bugs.debian.org/"

/ etc / issue file

The/etc/issue file contains the system identification text that appears before the login prompt. Typically, this file contains information about the Linux version:

cat /etc/issue

The output is as follows:

Debian GNU/Linux 9 \n \l

hostnamectl command

hostnamectl is part of systemd and can be used to query and change system hostnames. The command also displays the Linux distribution and kernel version.

hostnamectl

Output:

Static hostname: debian9.localdomain Icon name: computer-vm Chassis: vm Machine ID: a92099e30f704d559adb18ebc12ddac4 Boot ID: 7607cbe605d44f638d6542d4c7b3878e Virtualization: qemu Operating System: Debian GNU/Linux 9 (stretch) Kernel: Linux 4.9.0-8-amd64 Architecture: x86-64

uname command

The uname command displays multiple system information, including Linux kernel architecture, name version, and release.

To find out which Linux kernel version is running on your system, type the following command:

uname -srm

output

Linux 4.9.0-8-amd64 x86_64

The output above tells us that the Linux kernel is 64-bit and its version is "4.9.0-8-amd64."

How to check the Linux version is shared here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report