Common CentOS commands

Source: Internet
Author: User
Common CentOS commands are often used in common computer operations. Therefore, we provide a comprehensive solution for some frequently-used and Important CentOS commands.

Common CentOS commands are often used in common computer operations. Therefore, we have thoroughly organized some frequently-used and Important CentOS commands. The following describes common CentOS commands.

I. View cpu using common CentOS commands

More/proc/cpuinfo | grep "model name"
Grep "model name"/proc/cpuinfo
[Root @ localhost/] # grep "CPU"/proc/cpuinfo
Model name: Intel (R) Pentium (R) Dual CPU E2180 @ 2.00 GHz
Model name: Intel (R) Pentium (R) Dual CPU E2180 @ 2.00 GHz
If you feel more comfortable to watch
Grep "model name"/proc/cpuinfo | cut-f2-d:

II. View memory using common CentOS commands

Grep MemTotal/proc/meminfo | cut-f2-d: free-m | grep "Mem" | awk '{print $2 }'

III. use common CentOS commands to check whether the cpu is 32-bit or 64-bit

View CPU bits (32 or 64)
Getconf LONG_BIT

4. use common CentOS commands to view the current linux version

More/etc/redhat-release
Cat/etc/redhat-release

5. view the kernel version using common CentOS commands

Uname-r
Uname-

6. use common CentOS commands to view the current time

Date. the preceding section describes how to synchronize the time.

7. View hard disks and partitions using common CentOS commands

Df-h
Fdisk-l
You can also view partitions.
Du-sh
The occupied space is displayed.
Du/etc-sh
The directory size is displayed.

8. use common CentOS commands to view installed software packages

View the software packages installed during system installation
Cat-n/root/install. log
More/root/install. log | wc-l
Check the software packages that have been installed.
Rpm-qa
Rpm-qa | wc-l
Yum list installed | wc-l
But it is strange that the number of installation packages I query through rpm and yum is not the same. No reason is found.

9. view the keyboard layout using common CentOS commands

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

10. use common CentOS commands to view selinux information

Sestatus
Sestatus | cut-f2-d:
Cat/etc/sysconfig/selinux

11: Use common CentOS commands to view ip addresses and mac addresses

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 gateway cat/etc/sysconfig/network view dns cat/etc/resolv. conf 12: Use common CentOS commands to view the default language
Echo $ LANG $ LANGUAGE
Cat/etc/sysconfig/i18n

12: Use common CentOS commands to check the time zone and whether UTC time is used

Cat/etc/sysconfig/clock

Thirteen: Use common CentOS commands to view the host name

Hostname
Cat/etc/sysconfig/network
Modifying the host name is to modify this file, and it is recommended that you also modify the host file.

14. run common CentOS commands to view the startup time

Uptime
09:44:45 up 67 days, 23:32 ,...
It seems that this is indeed a problem with the network segment. I started the machine 67 days ago.
# System resource usage

Vmstat 1-S m procs ----------- memory ---------- --- swap -- ----- io ---- system -- ----- cpu ------ r B swpd free buff cache si so bi bo in cs us sy id wa st 0 0 233 199 778 0 0 0 25 1 1 3 0 0 0 0 0 0 233 199 778 0 0 0 1029 856 13 1 86 0

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.