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 to use the command line to check the system version and kernel version of Linux as well as the machine word length

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

Share

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

This article introduces the knowledge of "how to use the command line to check the system version and kernel version of Linux as well as the machine word length". In the operation of actual cases, many people will encounter this dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

View Linux version

1. Lsb_release-a (for all linux)

The code is as follows:

LSB Version:: base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch

Distributor ID: CentOS

Description: CentOS release 6.5 (Final)

Release: 6.5

Codename: Final

Note: if you prompt "- bash: lsb_release: command not found", you need to install the lsb_release command manually. Use yum install-y redhat-lsb

The following methods apply to RedHat and CentOS

The code is as follows:

# cat / etc/redhat-release

CentOS release 6.5 (Final)

Or check the system version by looking at the package name

Redhat execution:

The code is as follows:

# rpm-Q redhat-release

Centos execution

The code is as follows:

# rpm-Q centos-release

Centos-release-6-5.el6.centos.11.2.i686

Check the linux kernel version:

1. Uname-a

The code is as follows:

Linux default.hostname 2.6.32-042stab094.8 # 1 SMP Tue Dec 16 20:36:56 MSK 2014 i686 i686 i386 GNU/Linux

Or directly use the-r parameter

The code is as follows:

Uname-r

2.6.32-042stab094.8

2. Cat / proc/version

The code is as follows:

Linux version 2.6.32-042stab094.8 (root@kbuild-rh7-x64) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)) # 1 SMP Tue Dec 16 20:36:56 MSK 2014

Check the number of system digits (view machine word length)

1.。 Check to see if there is a / lib64 directory. 64-bit systems will have / lib64 and / lib directories, and 32-bit systems will have only / lib

The code is as follows:

# cd / | ls

2.getconf LONG_BIT

The code is as follows:

thirty-two

3.file / bin/ls view basic program binary information

The code is as follows:

/ bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

Note: if you don't have the file command, install the file command using yum install file.

View system detailed parameter information

The code is as follows:

Getconf-a

This is the end of "how to use the command line to check the system and kernel versions of Linux as well as the machine word length". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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