Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to view various service information in CentOS

Shulou Source: shulou.com Published: 2022-06-01 18:32:59 10月29日 Update

This article shows you how to view a variety of service information in CentOS, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

View 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 version of Linux

More / etc/redhat-release cat / etc/redhat-release

View the Linux kernel version

Uname-r

Uname-a

View the server's current time

Date

View server hard drives and partitions

Df-h

Fdisk-l

View directory siz

Du / etc-sh

View the software packages initially installed by 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 the 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,Mac address of the server network card

You can see mac, gateway and other information in the ifcfg-eth0 file.

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 server default gateway

Cat / etc/sysconfig/network

View the default DNS of the server

Cat / etc/resolv.conf

View server default language

Echo $LANG $LANGUAGE

Cat / etc/sysconfig/i18n

View the time zone and UTC time of the server

Cat / etc/sysconfig/clock

View server hostname

Hostname

Cat / etc/sysconfig/network

The above is how to view all kinds of service information in CentOS. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Services servers information content skills time versions knowledge gateways software packages concise concise host memory kernel address model size capacity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Xiaomi Linux MySQL