CentOS System Command

Source: Internet
Author: User
Tags nameserver

One, Linux view server System Information method:

1. View host name/kernel version/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 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 #查看当前登录用户名
    2. # ID #查看当前用户及其属组
    3. # W #查看当前登录的用户及运行的命令
    4. # Last #查看最近登录用户
    5. # cat/etc/passwd|awk-f: ' {print '} ' #查看服务器上面所有用户

5. View other System Information:

    1. # date ' +%y-%m-%d%h:%m:%s ' #查看系统时间
    2. # Ps-ef #查看运行进程
    3. # uptime #查看服务器开机时长, number of users, average load
    4. # Lsmod #查看所有加载的模块
    5. # env #查系统环境变量
    6. # crontab-l #查看计划任务


Second, Linux view server hardware device information:

1. View Server CPU Information:

    1. # grep ' model name '/proc/cpuinfo|awk-f: ' {print $} ' |sed ' s# # #g ' |uniq-c
    2. 8 Intel (R) Xeon (R) CPU E5630 @ 2.53GHz #8个核心的Intel Xeon CPU

2. View the number of server CPU bits:

    1. # getconf Long_bit
    2. 32

3. Check the network card model:

    1. # LSPCI |grep Ethernet
    2. Ethernet controller:broadcom Corporation netxtreme II BCM5709 Gigabit Ethernet (rev. 20)

4. View additional hardware information:

    1. # Lspci-tv #查看所有PCI设备
    2. # Lsusb-tv #查看所有usb外设
    3. # Cat/etc/sysconfig/keyboard #查看键盘布局


Third, Linux view server storage information:

1. View memory Information:

    1. # sed-n '/memtotal\| Memfree/p '/proc/meminfo
    2. memtotal:16426736 KB
    3. memfree:14171748 KB

2. View swap space:

    1. # sed-n '/swaptotal\| Swapfree/p '/proc/meminfo
    2. swaptotal:16771852 KB
    3. swapfree:16771852 KB

3. View mount partition space usage:

    1. # Df-h
    2. File system capacity has been used with available% mount points
    3. /dev/sda6 9.7G 570M 8.7G 7%/
    4. /dev/sda7 3.9G 73M 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 92M 12M 75M 14%/boot
    9. Tmpfs 7.9G 0 7.9G 0%/dev/shm


Iv. Linux View server network information:

1. View the Linux system hostname:

    1. # hostname
    2. Localhost.localdomain

2. View server IP Address:

    1. # Ifconfig|grep ' inet addr: ' |grep-v ' 127.0.0.1 ' |cut-d:-f2|awk ' {print '} '
    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 ports:

    1. # NETSTAT-LNTP #查看监听 (Listen) port
    2. # NETSTAT-ANTP #查看所有建立的TCP连接

5. View Linux Open service:

    1. # chkconfig--list|grep Enable #查看开启的服务
    2. sshd 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
    3. httpd 0: Off 1: Off 2: Off 3: Enabled 4: Off 5: off 6: Off

6. View Server DNS configuration:

    1. # cat/etc/resolv.conf
    2. NameServer 192.168.0.66
    3. NameServer 202.106.0.20

7. Other Network information:

      1. # Iptables-l #查看防火墙规则
      2. # route-n #查看路由表
      3. # netstat-s #查看网络统计信息

CentOS System Command

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.