take a look at the CentOS system information as an example
One: View CPU
less /proc/cpuinfo | grep "model name"
(less can be turned back, Space page, enter the next line; more can not be turned back, Space page, enter the next line)
grep "model name" /proc/cpuinfo
Feel the need to look comfortable:grep "model name" /proc/cpuinfo | cut -d: -f2
Two: View memory
free -m |grep "Mem" | awk ‘{print $2}‘
grep MemTotal /proc/meminfo
grep MemTotal /proc/meminfo | cut -d: -f2
Three: Check whether the CPU is 32-bit or 64-bit
uname -a
echo $HOSTTYPE
getconf LONG_BIT
Four: View the current version of Linux
less /etc/system-release
or cat /etc/redhat-release
orcat /etc/issue
V: View kernel version
uname -r
Oruname -a
VI: View current time
date
Seven: View hard disks and partitions
df -h
Ordf -hT
To view partitions:fdisk -l
To view the space occupied by the current directory:du -sh
To view the size of the/etc directory:du /etc -sh
Eight: View the installed packages
To view the system installation Fashion package: cat -n /root/install.log
orless /root/install.log | wc -l
To view the packages that are now installed: rpm -qa或 rpm -qa | wc -l
oryum list installed | wc -l
Nine: View the keyboard layout
cat /etc/sysconfig/keyboard
cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -d= -f2
Ten: View selinux status
cat /etc/sysconfig/selinux
sestatus
sestatus | cut -d: -f2
11: View Ip,mac Address
ifconfig
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}‘
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut -f2 -d=
View Gateway: route -n
or netstat -r
orip route show
To view DNS: cat /etc/resolv.conf
12: View Default language
echo $LANG $LANGUAGE
cat /etc/sysconfig/i18n
13: View your time zone and whether to use UTC time
cat /etc/sysconfig/clock
14: View Host Name
hostname
Orcat /etc/sysconfig/network
Common Query Summary:
1. Kernel version: Uname-r or uname-a
2. Memory capacity: Free-m or grep memtotal/proc/meminfo
3. Operating system version: Cat/etc/issue or Less/etc/system-release or cat/etc/redhat-release
4. View current user name: WhoAmI; View the user's Uid:id or cat/etc/passwd|grep "^root"
5.CPU name and number of cores: Less/proc/cpuinfo | grep "model name"
Summary of commands in Linux system to view kernel, CPU, memory, etc.