linux system view system information

A: cpu View

Nuclear Nuclear = Total # of the physical CPU number X every single physical CPU 
# = the total number of logical CPU number of X every single physical CPU core physical CPU number X hyperthreads

View the number of physical CPU #
cat / proc / cpuinfo | grep " physical id" | sort | uniq | wc -l

# Check each physical CPU core in the number (ie audit)
CAT / proc / cpuinfo | grep "the CPU Cores" | uniq

View the number of logical CPU #
cat / proc / cpuinfo | grep " processor" | wc -l

# View CPU information (model)
CAT / proc / cpuinfo | grep name | Cut -f2 -d: | uniq -c

 

II: View memory

grep MemTotal /proc/meminfo

grep MemTotal /proc/meminfo | cut -f2 -d:

free -m |grep "Mem" | awk '{print $2}'

Three: Check cpu 32-bit or 64-bit

See CPU digits (32 or 64)

getconf LONG_BIT

Four: View the current version of linux

more /etc/redhat-release

cat /etc/redhat-release

Five: Viewing the kernel version

uname -r

uname -a

 

 

Six: view the current time

date

Above it has been how to synchronize the time,

Seven: Check the hard disk and partition

df -h

fdisk -l

You can also view the partition

you -sh

You can see all the space occupied by

/ etc -sh

You can see the size of this directory

Eight: View Installed Packages

Time to view the installation of the system installed packages

cat -n /root/install.log

more /root/install.log | wc -l

View now those packages installed

rpm -qa

rpm -qa | wc -l

yum list installed | wc -l

But it is strange, I query through rpm, yum and installed two packages, the number is not the same. The reason was not found.

 

Nine: View keyboard layout

cat /etc/sysconfig/keyboard

cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=

Ten: View selinux case

sestatus

sestatus | -f2 cut -d:

cat /etc/sysconfig/selinux

XI: View ip, mac address

In the ifcfg-eth0 file you can see the information mac, gateways.

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 Gateway

cat /etc/sysconfig/network

View dns

cat /etc/resolv.conf

12: Check the default language

echo $LANG $LANGUAGE

cat /etc/sysconfig/i18n

Thirteen: View the timezone and whether to use UTC time

cat /etc/sysconfig/clock

14: View hostname

hostname

cat /etc/sysconfig/network

Modify the host name is to modify this file, but also the best host file is also modified.

View pci information lspci

View hard disk information df -lh

--head curl  www.163.com                view 163.com server environment

uptime see how long boot time

ifconfig eth0 up enabled network card eth0

/ Etc / initd / network restart to restart the network service

Five: Check system version hairstyle

method 1

  For linux systems only, there are hundreds of releases. For release method to view the version number

As with centos example. Enter lsb_release -a can

This command applies to all of linux, including Redhat, SuSE, Debian and other distributions

Method 2

If as shown above, no command

Can view the Cat / etc / xxx-release XX is the release name. As  centos-release

Method 3.

You can also see the / etc / issue to view the release version number of the file

Guess you like

Origin blog.csdn.net/wyqwilliam/article/details/92225253