How to view CentOS version information and linux system information through the command line

1. How to check the installed CentOS version information:

1.cat /proc/version
2.uname -a
3.uname -r
4.cat /etc/centos-release
5.lsb_release -a
6.hostnamectl

1. The output result of the first method is:

Linux version 3.10.0-1127.el7.x86_64 ([email protected])
(gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) 
#1 SMP Tue Mar 31 23:36:51 UTC 2020

2. The output result of the second method is:

Linux iZ2zeef9w9lslu4l0a92paZ 4.18.0-348.7.1.el8_5.x86_64 
#1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

3. The output result of the third method is:

4.18.0-348.7.1.el8_5.x86_64

4. The output of the fourth method is:

CentOS Linux release 8.5.2111

The version number of the CentOS operating system consists of three main parts. This command shows the release version number as 8.5.2111. More information about the version number is explained below:

  • The first part is "8", which means the main branch of CentOS.
  • The second part is "5", which means the latest minor version.
  • The last part is "2111", which is further divided into two parts: "21" indicates the year (2021) when the CentOS operating system was released, and "11" indicates the month, which is November.

5. The output of the fifth method is:

LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 8.5.2111
Release:		8.5.2111
Codename:		n/a

If the prompt command is not found, yum install -y redhat-lsbjust enter

6. The output of the sixth method is:

 Static hostname: iZ2zeef9w9lslu4l0a92paZ
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 20220428175905013885619890526287
           Boot ID: 0632f47cd13b468c82531fd45b2eaaed
    Virtualization: kvm
  Operating System: CentOS Linux 8
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-348.7.1.el8_5.x86_64
      Architecture: x86-64

2. How to check the linux version:

1.lsb_release -a
2.cat /etc/issue(仅适用于linux)
3.cat /etc/redhat-release
4.rpm -q centos-release

The output is:

CentOS Linux release 7.8.2003 (Core)

Check if the system is 64-bit or 32-bit:

第一种方式:getconf LONG_BIT
第二种方式:file /bin/ls
第三种方式:lsb_release  -a

3. Other commands of Centos system

1. View CPU configuration information

cat /proc/cpuinfo
lscpu

2. View memory configuration information

cat /proc/meminfo

3. View hard disk information

df -h

4. Check the kernel version

uname -a 

5. Modify the DNS configuration

vim /etc/resolv.conf

nameserver is the IP address of the DNS server, the first is the first choice, the second is the backup
insert image description here

6. Check the external network IP

curl cip.cc
curl ifconfig.me
curl ipinfo.io

Guess you like

Origin blog.csdn.net/weixin_45277161/article/details/129736533