View CentOS version information

Today, the editor will give you a detailed explanation of the command to view the CentOS version information.

(1) View the installed CentOS version information

1.cat /etc/issue view version

cat abbreviation concatenate cat command can be used to display and merge files.

CentOS release 6.6 (Final)

CentOS release version 6.6

The initial English name of etc was etcetera, and later everyone was more accustomed to calling it Editable Text Configuration. ETC is a system configuration file directory, which contains system startup scripts, startup configuration files, user login configuration files, network configuration files, httpd configuration files, IPSec configuration files, and other files.

  1. cat /etc/redhat-release to view CentOS version

3. cat /proc/version

proc is the abbreviation of process, which stores files related to the kernel.

show result:
    Linux version 2.6.32-504.12.2.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Mar 11 22:03:14 UTC 2015

We can see that the system uses Linux 2.6.32 kernel 64 as the operating system. GCC is a collection of GUN compilers, using version 4.4.5.

  1. uname -a is displayed as follows

Linux host 192-168-14-166
Linux version 2.6.32-504.12.2.el6.x86_64 64-bit

5 uname -r

Display result: 2.6.32-504.12.2.el6.x86_64

Analysis result: Linux version 2.6.32-504.12.2.el6.x86_64 64-bit

(2) Check whether the system is 32-bit or 64-bit
  1. getconf LONG_BIT or getconf WORD_BIT
Input: getconf LONG_BIT
Return result: 64
Input: getconf WORD_BIT
Return result: 32
Analysis: The int type and the long type in 32-bit systems are generally 4 bytes, and the int type in 64-bit systems is still 4 bytes, but long has become an 8-byte inux system that can be used "getconf WORD_BIT" and "Getconf LONG_BIT" gets the digits of word and long. On a 64-bit system, you should get 32 and 64 respectively.
So the system is 64 for Linux system.

2. file /bin/ls
  /bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

You can see the ELF 64-bit LSB, so the system is 64-bit

( adsbygoogle = window.adsbygoogle || []).push({});

Recommended Posts

View CentOS version information
View CentOS version information
CentOS 7.4 view CPU information (including script)
CentOS 7.0.1406 official version released
CentOS 7 system to view the system version and machine digits
Centos install high version GCC
Centos6.5 desktop version network settings
Centos7 install k8s cluster 1.15.0 version
Centos7.6 install MySQL+Redis (latest version)
CentOS 8 (2)
CentOS6 mininal install CouchDB2 detailed version
CentOS 8 (1)
Manually upgrade node version under CentOs
Manually upgrade node version under CentOs
CentOS8 Chinese input method (2020-10-31 latest version) installation method
Centos 7 64-bit desktop version installation graphic tutorial
Install mysql8.0.13 version under Linux CentOS7 system
Centos install the latest version of cmake