How Linux Views System Information (reproduced)

Source: Internet
Author: User
Tags nameserver

One: CPU

[Email protected]/]# More/proc/cpuinfo | grep "model name"

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

[[email protected]/]# grep "model name"/proc/cpuinfo

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Model Name:intel (R) Xeon (r) CPU X3220 @ 2.40GHz

[[email protected]/]# grep "model name"/proc/cpuinfo | Cut-f2-d:

Intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Intel (R) Xeon (r) CPU X3220 @ 2.40GHz

Two: Memory

[[email protected]/]# grep memtotal/proc/meminfo

memtotal:614400 KB

[Email protected]/]# free-m

Total used free shared buffers Cached

mem:600 23 576 0 0 0

-/+ buffers/cache:23 576

swap:0 0 0

[Email protected]/]# free-m |grep "Mem" | awk ' {print $} '

600

Three: View the number of CPU bits (+ or 64)

[Email protected]/]# getconf long_bit

32

Four: View Linux versions

[Email protected]/]# more/etc/redhat-release

CentOS Release 5 (Final)

[Email protected]/]# more/etc/issue

CentOS Release 5 (Final)

Kernel \ r on an \m

[Email protected]/]# more/proc/version

Linux version 2.6.18-92.1.18.el5.028stab060.2pae ([[email Protected]][email protected][/email]) (GC

C Version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Tue Jan 12:31:30 MSK 2009

V: View kernel version

[Email protected]/]# uname-r

2.6.18-92.1.18.el5.028stab060.2pae

[Email protected]/]# uname-a

Linux srv.eddiechen.cn 2.6.18-92.1.18.el5.028stab060.2pae #1 SMP Tue Jan 12:31:30 MSK-i686 i686 i386 Gnu/linux

VI: View time zone

[Email protected]/]# date-r

Wed, Feb 2009 02:20:50 +0000

[Email protected]/]# Mv/etc/localtime/etc/localtime.save

[Email protected]/]# Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime

[Email protected]/]# date-r

Wed, Feb 2009 10:24:26 +0800

Seven: Host name

View Host Name

[Email protected]/]# hostname

Www.ifuoo.com

Modify Host Name

[Email protected]/]# cat/etc/sysconfig/network

Eight: View selinux status

[Email protected]/]# Sestatus

SELinux status:disabled

Nine: Network

Ip

[Email protected]/]# Ifconfig | grep ' inet addr: ' | Grep-v ' 127.0.0.1 ' | Cut-d:-f2 | awk ' {print '} '

207.154.202.216

Gateway

[Email protected]/]# cat/etc/sysconfig/network

networking= "Yes"

Gateway= "192.0.2.1"

Hostname= "srv.eddiechen.cn"

Dns

[Email protected]/]# cat/etc/resolv.conf

NameServer 208.74.168.131

NameServer 208.74.168.132

NameServer 4.2.2.1

Modify the Host File

[Email protected]/]# cat/etc/hosts

Ten: Packages that have already been installed

[Email protected]/]# Rpm-qa | Wc-l

197

[email protected]/]# Yum List installed | Wc-l

198

11: Disks and partitions

[Email protected]/]# df-h

Filesystem Size used Avail use% mounted on

/dev/simfs 10G 353M 9.7G 4%/

[Email protected]/]# Du-sh

353M

[Email protected]/]# Du/etc-sh

4.6m/etc

Nine: View the keyboard layout

Cat/etc/sysconfig/keyboard

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

12: View Default language

echo LANGLANGUAGE

cat/etc/sysconfig/i18n

==================================

http://hi.baidu.com/mypc007

You can view the size of the physical memory that the rs/6000 system is equipped with by using the following command.

LSDEV-CC Memory

To view the physical memory devices configured by the rs/6000, here is an example of their output:

Mem0 Available 00-00 Memory

L2cache0 Available 00-00 L2 Cache

Re-use command

Lsattr-el MEM0

The output is as follows

Size amount of physical memory in Mbytes False

Goodsize Amount of usable physical memory in Mbytes False

This example shows that the physical memory of the machine is 512MB. If the previous Lsdev output has a device name of MEM1, use the same command to see its corresponding size and so on. L2CACHE0 is the device name for the system two cache (Level 2 cache). Similarly, use the command:

Lsattr-el L2CACHE0

You can see its size.

View the number of Linux system bits

1. Programming Implementation:

Returns the value of sizeof (int) in the program, and the result is the number of bytes of the operating system. If return 4 is a 32-bit operating system, return 8 is 64 bits.

2.getconf command:

The getconf command can obtain basic configuration information of the system, such as the number of operating system bits, memory size, disk size, etc.

For example:

To determine the size of the disk hdisk0, if the root user, enter:

Getconf Disk_size/dev/hdisk0

Determine actual memory size: getconf real_memory

Determine if the machine hardware is 32-bit or 64-bit: getconf Hardware_bitmode

Determine if the kernel is 32-bit or 64-bit: getconf Kernel_bitmode

If the above getconf Kernel_bitmode method is unsuccessful (not successful on my machine), it may be because the version is inconsistent, you can try again using: getconf word_bit, this command returns the length of the int type, which is consistent with sizeof (int).

How Linux Views System Information (reproduced)

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.