Linux View System Information commands and methods __linux

Source: Internet
Author: User
first, Linux to view server System Information methods:

1. View host name/kernel version/CPU architecture: # uname-n-r-p-o localhost.localdomain 2.6.32-220.el6.i686 i686

2. View Linux system type and version: # head-n 1/etc/issue CentOS Release 6.2 (Final)

3, view the language character set settings: # echo $LANG $LANGUAGE zh_cn. UTF-8 # cat/etc/sysconfig/i18n lang= "ZH_CN. UTF-8 "

4, view users: # whoami #查看当前登录用户名 # ID #查看当前用户及其属组 # w #查看当前登录的用户及运行的命令 # last #查看最近登录用户 # cat/etc/passwd|awk-f: ' {print '} ' #查看服务器上面所有用户

5, view other System Information: # Date ' +%y-%m-%d%h:%m:%s ' #查看系统时间 # ps-ef #查看运行进程 # uptime #查看服务器开机时长, number of users, average load # lsmod #查看所有加载的模块 # env #查系 environment variable # crontab-l #查看计划任务



Second, Linux view server hardware device information:

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

2, view server CPU number: # getconf Long_bit 32

3. View network card model: # LSPCI |grep Ethernet Ethernet controller:broadcom Corporation netxtreme II BCM5709 Gigabit Ethernet (rev. 20)

4, view Other hardware information: # LSPCI-TV #查看所有PCI设备 # lsusb-tv #查看所有usb外设 # Cat/etc/sysconfig/keyboard #查看键盘布局



Third, Linux view server storage information:

1, view memory information: # sed-n '/memtotal\| memfree/p '/proc/meminfo memtotal:16426736 kb memfree:14171748 kb

2, view the swap space: # sed-n '/swaptotal\| swapfree/p '/proc/meminfo swaptotal:16771852 kb swapfree:16771852 kb

3, view the use of the Mount partition space: # DF-H File system capacity used available% mount point/dev/sda6 9.7G 570M 8.7G 7%//dev/sda7 3.9G 73M 3.7G 2%/tmp/dev/sda2 20G 2.5G 16G 14%/var/dev/sda8 388G 4.9G 363G 2%/storage/dev/sda5 15G 2.4G 12G 18%/usr/dev/sda1 92M 12M 75M 14%/boot tmp FS 7.9G 0 7.9G 0%/dev/shm



Four, Linux view server network information:

1, view the Linux system host name: # hostname Localhost.localdomain

2, view the server IP address: # ifconfig|grep ' inet addr: ' |grep-v ' 127.0.0.1 ' |cut-d:-f2|awk ' {print '} ' 192.168.17.238 192.168.1.9

3. View Linux Gateway: # route |grep default default 192.168.1.1 0.0.0.0 UG 0 0 0 em1

4, view the Linux port: # netstat-lntp #查看监听 (Listen) port # NETSTAT-ANTP #查看所有建立的TCP连接

5. View Linux Open service: # chkconfig--list|grep enabled #查看开启的服务 sshd 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Close httpd 0: Close 1: Close 2: Close 3: Turn off 4: Off 5: Close 6: Off

6. View Server DNS configuration: # cat/etc/resolv.conf nameserver 192.168.0.66 nameserver 202.106.0.20

7, Other network information: # iptables-l #查看防火墙规则 # route-n #查看路由表 # netstat-s #查看网络统计信息

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.