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.
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.
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