CentOS command for viewing various service information

Source: Internet
Author: User
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

Related Article

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.