View System Information in CentOS-CentOS command
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. Check in
- [root@CentOS ~]# grep MemTotal /proc/meminfo
- [root@CentOS ~]# grep MemTotal /proc/meminfo | cut -f2 -d:
- [root@CentOS ~]# free -m |grep "Mem" | awk '{print $2}'
- [root@CentOS ~]# free -m
Iii. Check whether the cpu is 32-bit or 64-bit
View CPU bits (32 or 64)
- [root@CentOS ~]# getconf LONG_BIT
- [root@CentOS ~]# echo $HOSTTYPE
- [root@CentOS ~]# uname -a
Iv. view the current linux version
- [root@CentOS ~]# more /etc/redhat-release
- [root@CentOS ~]# cat /etc/redhat-release
V. view the kernel version
- [root@CentOS ~]# uname -r
- [root@CentOS ~]# uname -a
6. view the current time
- [root@CentOS ~]# date
7. View hard disks and partitions
- [root@CentOS ~]# df -h
- [root@CentOS ~]# fdisk -l
You can also view partitions.
- [root@CentOS home]# du -sh
The occupied space is displayed.
- [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
- cat -n /root/install.log
- more /root/install.log | wc -l
Check the software packages that have been installed.
- [root@CentOS home]# rpm -qa
- .......................
- .......................
- .......................
- .......................
- .......................
- [root@CentOS home]# rpm -qa | wc -l
- [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
- [root@CentOS home]# cat /etc/sysconfig/keyboard
- [root@CentOS home]# cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=
10. View selinux Information
- [root@CentOS home]# sestatus
- [root@CentOS home]# sestatus | cut -f2 -d:
- [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.
- [root@CentOS home]# ifconfig
- [root@CentOS home]# cat /etc/sysconfig/network-scripts/ifcfg-Auto_eth0
- [root@CentOS home]# cat /etc/sysconfig/network-scripts/ifcfg-Auto_eth0 | grep IPADDR | cut -f2 -d=
- [root@CentOS home]# ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|cut -c 6-
- [root@CentOS home]# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
View Gateway
- [root@CentOS home]# cat /etc/sysconfig/network
View dns
- [root@CentOS home]# cat /etc/resolv.conf
12: view the default language
- [root@CentOS home]# echo $LANG $LANGUAGE
- [root@CentOS home]# cat /etc/sysconfig/i18n
Thirteen: Check the time zone and whether the UTC time is used.
- [root@CentOS /]# cat /etc/sysconfig/clock
14. view the Host Name
- [root@CentOS /]# hostname
- [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.