View System Information in CentOS-CentOS command

Source: Internet
Author: User

View System Information in CentOS-CentOS command

I. View cpu

 
 
  1. more /proc/cpuinfo | grep "model name"  
  2. grep "model name" /proc/cpuinfo 

If you feel more comfortable to watch

 
 
  1. grep "model name" /proc/cpuinfo | cut -f2 -d: 

How about linux commands.

Ii. Check in

 
 
  1. [root@CentOS ~]# grep MemTotal /proc/meminfo  
  2. [root@CentOS ~]# grep MemTotal /proc/meminfo | cut -f2 -d:  
  3. [root@CentOS ~]# free -m |grep "Mem" | awk '{print $2}'  
  4. [root@CentOS ~]# free -m 

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

View CPU bits (32 or 64)

 
 
  1. [root@CentOS ~]# getconf LONG_BIT  
  2. [root@CentOS ~]# echo $HOSTTYPE  
  3. [root@CentOS ~]# uname -a 

Iv. view the current linux version

 
 
  1. [root@CentOS ~]# more /etc/redhat-release  
  2. [root@CentOS ~]# cat /etc/redhat-release 

V. view the kernel version

 
 
  1. [root@CentOS ~]# uname -r  
  2. [root@CentOS ~]# uname -a 

6. view the current time

 
 
  1. [root@CentOS ~]# date 

7. View hard disks and partitions

 
 
  1. [root@CentOS ~]# df -h  
  2. [root@CentOS ~]# fdisk -l 

You can also view partitions.

 
 
  1. [root@CentOS home]# du -sh 

The occupied space is displayed.

 
 
  1. [root@CentOS home]# du /var/www -sh 

The directory size is displayed.

8. View installed software packages

View the software packages installed during system installation

 
 
  1. cat -n /root/install.log  
  2. more /root/install.log | wc -l 

Check the software packages that have been installed.

 
 
  1. [root@CentOS home]# rpm -qa  
  2. .......................  
  3. .......................  
  4. .......................  
  5. .......................  
  6. .......................  
  7. [root@CentOS home]# rpm -qa | wc -l  
  8. [root@CentOS home]# 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

 
 
  1. [root@CentOS home]# cat /etc/sysconfig/keyboard  
  2. [root@CentOS home]# cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d= 

10. View selinux Information

 
 
  1. [root@CentOS home]# sestatus  
  2. [root@CentOS home]# sestatus | cut -f2 -d:  
  3. [root@CentOS home]# cat /etc/sysconfig/selinux 

11. View ip address and mac address

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

 
 
  1. [root@CentOS home]# ifconfig  
  2. [root@CentOS home]# cat /etc/sysconfig/network-scripts/ifcfg-Auto_eth0  
  3. [root@CentOS home]# cat /etc/sysconfig/network-scripts/ifcfg-Auto_eth0 | grep IPADDR | cut -f2 -d=  
  4. [root@CentOS home]# ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|cut -c 6-  
  5. [root@CentOS home]# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' 

View Gateway

 
 
  1. [root@CentOS home]# cat /etc/sysconfig/network 

View dns

 
 
  1. [root@CentOS home]# cat /etc/resolv.conf 

12: view the default language

 
 
  1. [root@CentOS home]# echo $LANG $LANGUAGE  
  2. [root@CentOS home]# cat /etc/sysconfig/i18n 

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

 
 
  1. [root@CentOS /]# cat /etc/sysconfig/clock 

14. view the Host Name

 
 
  1. [root@CentOS /]# hostname  
  2. [root@CentOS /]# cat /etc/sysconfig/network 

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

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.