The following uses Centos as an example to share various information viewing methods with users. This tutorial uses Centos, Debian, and other Linux releases to view the server CPU model.
Grep "model name"/proc/cpuinfo | cut-f2-d:
View server memory capacity
Grep MemTotal/proc/meminfo
Grep MemTotal/proc/meminfo | cut-f2-d:
Free-m | grep "Mem" | awk '{print $2 }'
Check whether the server's CPU is 32-bit or 64-bit
Getconf LONG_BIT
View the current Linux version
More/etc/redhat-release cat/etc/redhat-release
View Linux kernel version
Uname-r
Uname-
View current server time
Date
View server hard disks and partitions
Df-h
Fdisk-l
View directory size
Du/etc-sh
View the software packages initially installed on the server
Cat-n/root/install. log
More/root/install. log | wc-l
View installed software packages
Rpm-qa
Rpm-qa | wc-l
Yum list installed | wc-l
View Server keyboard layout
Cat/etc/sysconfig/keyboard
Cat/etc/sysconfig/keyboard | grep KEYTABLE | cut-f2-d =
View Selinux status
Sestatus
Sestatus | cut-f2-d:
Cat/etc/sysconfig/selinux
View the ip address and Mac address of the server NIC
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 $2}' | cut-c 6-
Ifconfig | grep 'inet addr: '| grep-v' 127. 0.0.1' | cut-d:-f2 | awk '{print $1 }'
View default server gateways
Cat/etc/sysconfig/network
View the default DNS of the server
Cat/etc/resolv. conf
View default server language
Echo $ LANG $ LANGUAGE
Cat/etc/sysconfig/i18n
View the time zone and UTC time of the server
Cat/etc/sysconfig/clock
View server host names
Hostname
Cat/etc/sysconfig/network