Centos command and method for viewing system information

Source: Internet
Author: User
The commands and methods used to view system information under the collected Linux system will be useful to you. 1. How to view server system information in Linux:

1. Check the host name, kernel version, and CPU architecture:

  1. # Uname-n-r-p-o

  2. Localhost. localdomain 2.6.32-220. el6.i686 i686

 

2. view the Linux system type and version:

  1. # Head-N 1/etc/issue

  2. Centos Release 6.2 (final)

3. view the Language Character Set settings:

  1. # Echo $ Lang $ Language

  2. Zh_CN.UTF-8

  3. # Cat/etc/sysconfig/i18n

  4. Lang = "zh_CN.UTF-8"

4. View users:

  1. # Whoami # view the current logon User Name

  2. # ID # view the current user and its Group

  3. # W # view currently logged on users and running commands

  4. # Last # view recently logged on users

  5. # Cat/etc/passwd | awk-F: '{print $1}' # view all users on the server

5. view other system information:

  1. # Date '+ % Y-% m-% d % H: % m: % s' # view system time

  2. # Ps-Ef # view running processes

  3. # Uptime # view the server startup duration, number of users, and average load

  4. # Lsmod # view all loaded modules

  5. # Env # Check System Environment Variables

  6. # Crontab-L # view scheduled tasks


 

Ii. View server hardware information in Linux:

1. view the server CPU information:

  1. # Grep 'model name'/proc/cpuinfo | awk-F: '{print $2}' | SED's ### G' | uniq-C

  2. 8 Intel (r) Xeon (r) CPU e5630 @ 2.53 GHz #8-core Intel Xeon CPU

2. view the server CPU count:

  1. # Getconf long_bit

  2. 32

3. view the NIC model:

  1. # Lspci | grep Ethernet

  2. Ethernet controller: Broadcom Corporation netxtreme II bcm5709 Gigabit Ethernet (Rev 20)

4. view other hardware information:

  1. # Lspci-TV # view all PCI devices

  2. # Lsusb-TV # view all USB peripherals

  3. # Cat/etc/sysconfig/keyboard # view keyboard layout


 

Iii. View server storage Information in Linux:

1. view memory information:

  1. # Sed-n'/memtotal \ | memfree/P'/proc/meminfo

  2. Memtotal: 16426736 KB

  3. Memfree: 14171748 KB

2. view the swap space:

  1. # Sed-n'/swaptotal \ | swapfree/P'/proc/meminfo

  2. Swaptotal: 16771852 KB

  3. Swapfree: 16771852 KB

3. view the usage of the mounted partition space:

  1. # DF-H

  2. File System capacity used available % mount point

  3. /Dev/sda6 9.7g 570 M 8.7g 7%/

  4. /Dev/sda7 3.9g 73 m 3.7g 2%/tmp

  5. /Dev/sda2 20g 2.5G 16g 14%/var

  6. /Dev/sda8 388g 4.9g 363g 2%/storage

  7. /Dev/sda5 15g 2.4g 12g 18%/usr

  8. /Dev/sda1 92 MB 12 m 75 m 14%/boot

  9. Tmpfs 7.9g 0 7.9g 0%/dev/SHM


 

4. View server network information in Linux:

1. Check the Linux host name:

  1. # Hostname

  2. Localhost. localdomain

2. view the Server IP Address:

  1. # Ifconfig | grep 'inet ADDR: '| grep-V' 127. 0.0.1' | cut-D:-F2 | awk '{print $1 }'

  2. 192.168.17.238

  3. 192.168.1.9

3. view the Linux Gateway:

  1. # Route | grep default

  2. Default 192.168.1.1 0.0.0.0 ug 0 0 0 Em1

4. view the Linux Port:

  1. # Netstat-lntp # view the listening port (Listen)

  2. # Netstat-antp # view all established TCP connections

5. view the Linux service:

  1. # Chkconfig -- list | grep enabled # view enabled services

  2. Sshd 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable

  3. Httpd 0: Disabled 1: Disabled 2: Disabled 3: enabled 4: Disabled 5: Disabled 6: Disabled

6. view the DNS configuration of the server:

  1. # Cat/etc/resolv. conf

  2. Nameserver 192.168.0.66

  3. Nameserver 202.106.0.20

7. other network information:

  1. # Iptables-L # view firewall rules

  2. # Route-N # view the route table

  3. # Netstat-s # view network statistics


This article is from the blog "getting hurt with the red dust". For more information, contact the author!

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.