CentOS View hardware Information

Source: Internet
Author: User
Tags dmesg kingston technology

1, under the CentOS View hardware information content is very comprehensive.

CentOS Common commands to view CPUs
More/proc/cpuinfo | grep "model name"
grep "model name"/proc/cpuinfo
[[email protected]/]# grep "CPU"/proc/cpuinfo
Model Name:intel (R) Pentium (r) Dual CPU E2180 @ 2.00GHz
Model Name:intel (R) Pentium (r) Dual CPU E2180 @ 2.00GHz
2. CentOS common commands to view memory
grep memtotal/proc/meminfo grep memtotal/proc/meminfo | cut-f2-d: free-m |grep "Mem"
| awk ' {print $} '
3. Use CentOS common commands to see if the CPU is 32-bit or 64-bit
View the number of CPU bits (+ or 64)
Getconf Long_bit
4. Use CentOS common commands to view the current version of Linux
More/etc/redhat-release
Cat/etc/redhat-release
5. Use CentOS common commands to view kernel version
Uname-r
Uname-a
6. Use CentOS common commands to view hard disks and partitions
Df-h Fdisk-l can also view partitions
Du-sh can see all the space occupied
Du/etc-sh can see the size of this directory
7. Use CentOS common commands to view installed packages
To view the packages installed on the system
Cat-n/root/install.log
More/root/install.log | Wc-l
8. Use CentOS common commands to view the keyboard layout
Cat/etc/sysconfig/keyboard
Cat/etc/sysconfig/keyboard | grep KEYTABLE | Cut-f2-d=
9. Use CentOS common commands to view selinux situation
Sestatus
Sestatus | Cut-f2-d:
Cat/etc/sysconfig/selinux
10. Use CentOS Common command to view Ip,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 $} ' |cut-c 6-ifconfig | grep ' inet addr: ' | Grep-v ' 127.0.0.1′| Cut-d:-f2 | awk ' {print '} '

View Gateway cat/etc/sysconfig/network View DNS cat/etc/resolv.conf 12: Use CentOS common commands to check
See the default language
Echo $LANG $LANGUAGE
cat/etc/sysconfig/i18n
11. Use CentOS common commands to see your time zone and whether to use UTC time
Cat/etc/sysconfig/clock
12. Use CentOS common commands to view the host name
Cat/etc/sysconfig/network
Modify the hostname is to modify this file, but also preferably the host file also modified.
13: Use CentOS common commands to see boot uptime
Uptime
09:44:45 up, 23:32, ...
14. View motherboard Information
Dmidecode |more

**************************************************************************************************

1. View all hardware information for the machine:

Dmidecode |more

DMESG |more

The 2 commands are very informative, so it is recommended to use "|more" later for easy viewing

2. View CPU Information

Method One:

CPU-related parameters in Linux are stored in the/proc/cpuinfo file.

Cat/proc/cpuinfo |more

Method Two:

Take Command DMESG | grep CPU can view boot information to related CPU

To view the number of bits of CPU:

Getconf Long_bit

3. View mem Information

Cat/proc/meminfo |more (Note the last line of output information: machinemem:41932272 KB)

Free-m

Top

4. View disk Information

Method One:

Fdisk-l can see the partition of the disk (including the USB flash drive) on the system and the information about the size.

Method Two:

View directly

Cat/proc/partitions

5. View network card information

Method One:

Ethtool eth0 Use this command to view the technical specifications related to the NIC

(This command is not necessarily supported by all network cards)

Ethtool-i eth1 Plus-i parameter view NIC driver

Other parameters can be tried to see the technical parameters of the network card

Method Two:

Also available through DMESG | grep eth0 etc See nic name (manufacturer) and other information

View/etc/sysconfig/network-scripts/ifcfg-eth0 to see the current network adapter configuration including IP, gateway address and other information.

Of course, it can also be viewed through the ifconfig command.

6. How do I view motherboard information?

Lspci

7. How to mount the ISO file

Mount-o loop-t iso9660 *.iso mount_point

Uninstall Direct Umount Mount_point

8. How to view disc-related information

Method One:

After inserting the CD, in my RHEL5 system, the CD-ROM file is/dev/cdrom,

So just mount/dev/cdrom mount_point.

[Email protected] tmp]# Mount/dev/cdrom mount_point

Mount:block Device/dev/cdrom is write-protected, mounting read-only

In fact, a closer look at the CD-ROM device file is hdc

[Email protected] tmp]# ls-l/dev/cdrom*

lrwxrwxrwx 1 root root 3 01-08 08:54/dev/cdrom, HDC

lrwxrwxrwx 1 root root 3 01-08 08:54/DEV/CDROM-HDC, HDC

So we can do this mount/dev/hdc mount_point

If a valid disc is not in the optical drive, the error is:

[Email protected] tmp]# MOUNT/DEV/HDC mount_point

Mount: Media not found

9. How to view USB device-related

Method One:

In fact, through the fdisk-l command can view the access to the USB stick information, my U disk information as follows:

disk/dev/sda:2012 MB, 2012217344 bytes

Heads, Sectors/track, 7676 cylinders

Units = Cylinders of * 262144 bytes

Device Boot Start End Blocks Id System

/DEV/SDA1 * 7676 1961024 b W95 FAT32

USB flash drive Device file is/dev/sda,2g size, FAT32 format.

If the user does not log on to the Linux GUI, the USB stick will not be automatically mounted.

This can be mounted by hand (Mount):

MOUNT/DEV/SDA1 Mount_point

The above command to mount the USB drive to the current directory of the Mount_point directory, note that the SDA1 is not SDA.

The uninstall command is Umount mount_point

Linux does not have a drive that supports NTFS-formatted disks by default, but is well-supported for FAT32 and does not normally require the-T VFAT parameter when mounted.

If NTFS is supported, the NTFS-formatted disk partition should use the-T NTFS parameter.

If garbled, you can consider using the-o iocharset= character set parameter.

The USB device information can be viewed via the LSUSB command:

[Email protected] tmp]# LSUSB

Bus 001 Device 001:id 0000:0000

Bus 002 Device 001:id 0000:0000

Bus 003 Device 001:id 0000:0000

Bus 004 Device 002:id 0951:1613 Kingston Technology

Bus 004 Device 001:id 0000:0000

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

Get memory, CPU true number of cores method

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

Linux Memory viewing mode

The following shows that free is the current memory usage that is displayed, and-m means that the contents are displayed in M. bytes. Let's have a look.

$ free-m
             total        used       free     shared    buffers     Cached
mem:         1002         769        232           0         62         421
-/+ buffers/cache:        286         715
swap:         1153           0       1153

The first part of the MEM line:
Total Memory: 1002M
Used number of memory used: 769M
Free amount of Memory: 232M
GKFX is currently obsolete. No, always 0.
Buffers Buffer Cache Memory: 62M
Cached Page Cache Memory: 421M

Relationship: Total (1002M) = Used (769M) + Free (232M)

Part II (-/+ Buffers/cache):
(-buffers/cache) Used memory: 286M (refers to the first part of the Mem line in the used-buffers-cached)
(+buffers/cache) Free memory: 715M (refers to the first part of the Mem line of Free + buffers + cached)

The visible-buffers/cache reflects the memory that is actually eaten by the program, and +buffers/cache reflects the total amount of memory that can be appropriated.

The third part refers to the exchange of partitions, I do not want to say that we all understand.

I think we looked at it, still very faint. The results of Part One (MEM) and Part Two (-/+ Buffers/cache) about used and free are so strange.
In fact, we can explain it from two aspects.
It is a mem parameter for the operating system. Buffers/cached are all part of being used, so it thinks free is only 232.
For the application It is (-/+ Buffers/cach). buffers/cached is equivalent, because buffer/cached is to improve the performance of the program execution, when the program makes

Buffer/cached will be used quickly when memory is used.

So, take a look at the application, to (-/+ Buffers/cache) of the free and used-based. So let's look at this. In addition to tell you some common sense. Linux in order to improve disk

and memory access efficiency, Linux has done a lot of careful design, in addition to the Dentry cache (for VFS, speed up the file path name to Inode conversion), but also took two kinds of master

To cache mode: Buffer cache and Page cache. The former is for the disk block read and write, the latter for the file inode read and write. These caches can effectively shorten the I/O system

The time of the call (such as read,write,getdents).

Remember that memory is for use, not to take a look. Unlike Windows, no matter how much of your real physical memory, he will have to take the hard disk swap files to read. This is why Windows

What is often the reason for the lack of virtual space. You think, how boring, in the memory and most of the time, take out some of the hard disk space to act as memory. How fast does the hard drive go?

Memory. So we look at Linux, as long as we do not swap space swap, there is no need to worry about their memory too little. If you use a lot of swap, you might want to consider adding physical memory.

This is the standard for Linux to see if memory is adequate.

View CPU Real core count under Linux

Many people know that tapping cat/proc/cpuinfo directly can see detailed CPU information.

Information will be divided into processor 0-n, if you think N is the true number of CPU cores, it is a big mistake.

We know that Intel has Hyper-Threading technology (HT), which can logically divide the number of CPUs out. Therefore, it is not allowed to see the number of processor.

The true number of cores should be the CPU cores this parameter value.

[Email protected] logs]$ Cat/proc/cpuinfo

processor:0

Vendor_id:genuineintel

CPU Family:6

Model:15

Model Name:intel (R) Xeon (r) CPU E5310 @ 1.60GHz

Stepping:7

CPU mhz:1596.035

Cache size:4096 KB

Physical id:0

Siblings:4

Core id:0

CPU Cores:4

Fdiv_bug:no

Hlt_bug:no

F00f_bug:no

Coma_bug:no

Fpu:yes

Fpu_exception:yes

CPUID Level:10

Wp:yes

FLAGS:FPU VME de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR

SSE SSE2 SS HT TM PBE NX LM CONSTANT_TSC PNI monitor ds_cpl tm2 XTPR

bogomips:3194.26

The number of physical CPUs can be several physical IDs with no duplicates.

Transferred from: http://www.cnblogs.com/summergarden/archive/2013/05/25/3098417.html

CentOS View hardware Information

Related Article

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.