Commands and methods for viewing the kernel, CPU, memory, and component versions in Linux

Source: Internet
Author: User

Commands and methods for viewing the kernel, CPU, memory, and component versions in Linux

Commands and methods for viewing the kernel, CPU, memory, and component versions in Linux

Linux Kernel version: uname-
More/etc/* release
More/etc/RedHat-release
More/proc/version

View CPU information: grep "model name"/proc/cpuinfo
More/proc/cpuinfo

View CPU bits: getconf LONG_BIT
Ls if ls has lib64 folder under root, the system 64

View libc and gcc versions: ldd/sbin/mii-tool
Rpm-qa | grep glibc
Gcc-v

View memory information: more/proc/meminfo

Grep MemTotal/proc/meminfo
CentOS allows you to view CPU, memory, version, and other system information.
 
View System Information in CentOS

I. View CPU

More/proc/cpuinfo | grep "model name"

Grep "model name"/proc/cpuinfo

If you feel more comfortable to watch

Grep "model name"/proc/cpuinfo | cut-f2-d:

How about Linux commands.

Ii. view memory

Grep MemTotal/proc/meminfo

Grep MemTotal/proc/meminfo | cut-f2-d:

Free-m | grep "Mem" | awk '{print $2 }'

Iii. Check whether the cpu is 32-bit or 64-bit

View CPU bits (32 or 64)

# Getconf LONG_BIT

# Echo $ HOSTTYPE

# Uname-

Iv. view the current linux version

# More/etc/RedHat-release

# Cat/etc/redhat-release

V. view the kernel version

# Uname-r

# Uname-

6. view the current time

Date

7. View hard disks and partitions

Df-h

  

Fdisk-l

You can also view partitions.

Du-sh

The occupied space is displayed.

Du/etc-sh

The directory size is displayed.

8. View installed software packages

View the software packages installed during system installation

Cat-n/root/install. log

More/root/install. log | wc-l

Check the software packages that have been installed.

Rpm-qa

Rpm-qa | wc-l

Yum list installed | wc-l

But it is strange that the number of installation packages I query through rpm and yum is not the same. No reason is found.

9. view the keyboard layout

Cat/etc/sysconfig/keyboard

Cat/etc/sysconfig/keyboard | grep KEYTABLE | cut-f2-d =

10. View selinux Information

Sestatus

Sestatus | cut-f2-d:

Cat/etc/sysconfig/selinux

11. View ip address and mac address

In the ifcfg-eth0 file you can see mac, Gateway and other information.

Ifconfig

Cat/etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR

Cat/etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut-f2-d =

Ifconfig eth0 | grep "inet addr:" | awk '{print $2}' | cut-c 6-

Ifconfig | grep 'inet addr: '| grep-V' 127. 0.0.1' | cut-d:-f2 | awk '{print $1 }'

View Gateway

Cat/etc/sysconfig/network

View dns

Cat/etc/nf

12: view the default language

Echo $ LANG $ LANGUAGE

Cat/etc/sysconfig/i18n

Thirteen: Check the time zone and whether the UTC time is used.

Cat/etc/sysconfig/clock

14. view the Host Name

Hostname

Cat/etc/sysconfig/network

Modifying the host name is to modify this file, and it is best to modify the host file as well.

1. kernel version: popen ("uname-sr", "r ");
2. Memory Capacity:/proc/meminfo 'memtotal: 'field
3. operating system version:/etc/issue or/etc/* release
4. Current User name: a. getuid () to obtain the uid of the current user; B. getpwuid (uid) or user name
5. cpu name:/proc/cpuinfo 'model name' Field
6. Number of cpu cores:/proc/cpuinfo 'processor 'field Maximum Value + 1 (number of logical cores), 'Physical id' field Maximum Value + 1

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.