Linux command to view system information

Linux command to view system information

lsb_release ,uname,cat /etc/redhat-release,cat /proc/version

The command prompt is root@hollowman-F117:~#: Log in as user hollowman in Ubuntu Kylin 20.10/ubuntu20.10, and switch to the root user for testing after opening the terminal. The
command prompt is [root@hollowman ~]#: in RHEL8 /CentOS8 directly log in as the root user and test

1.lsb_release -a (applicable to Debain, ubuntu and other releases)

root@hollowman-F117:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.10
Release:	20.10
Codename:	groovy

2.cat /etc/redhat-release (applicable to redhat, centos and other releases)

Redhat, centos release version /etc/redhat-releasefiles are stored in the system version information.

[root@hollowman ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.0 (Ootpa)

3.uname

Display operating system information, with options to display the required information, such as -n displays the host name, -i displays the hardware platform, -s displays the operating system name, and -a displays all information

root@hollowman-F117:~# uname -a
Linux hollowman-F117 5.8.0-38-generic #43-Ubuntu SMP Tue Jan 12 12:42:13 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@hollowman ~]# uname -a
Linux hollowman.cn 4.18.0-80.el8.x86_64 #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

4.cat /proc/version

/proc/versionInformation about the system version is stored in the file.

root@hollowman-F117:~# cat /proc/version
Linux version 5.8.0-38-generic (buildd@lgw01-amd64-022) (gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0, GNU ld (GNU Binutils for Ubuntu) 2.35.1) #43-Ubuntu SMP Tue Jan 12 12:42:13 UTC 2021
[root@hollowman ~]# cat /proc/version 
Linux version 4.18.0-80.el8.x86_64 ([email protected]) (gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)) #1 SMP Wed Mar 13 12:02:46 UTC 2019

Guess you like

Origin blog.csdn.net/ymz641/article/details/113007252