歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 查看Linux基本系統信息

查看Linux基本系統信息

日期:2017/2/28 13:52:37   编辑:Linux教程

查看Linux基本系統信息

#! /bin/bash
#The scripts will return the system infomation

#return hostname and version infomation // 返回主機名和系統版本信息
echo -e "\e[31;43m///// HOSTNAME INFOMATION *****\e[0m"
hostname
uname -r
cat /proc/version
echo ""

#File system disk space usage // 文件系統磁盤可用空間
echo -e "\e[31;43m***** File System Disk Space usage INFOMATION *****\e[0m"
df -h
echo ""

#Idie time system and use of memory //系統空閒和使用中的內存
echo -e "\e[31;43m***** Idie system And use of memory infomation *****\e[0m"
free
echo ""

#system start time //系統啟動時間
echo -e "\e[31;43m***** System start time INFOMATION *****\e[0m"
uptime
echo ""

#User logged on //登錄的用戶
echo -e "\e[31;43m***** User logged on INFOMATION *****\e[0m"
who
echo ""

#Use memory up to five processes //使用內存最多的五個進程
echo -e "\e[31;43m***** Use memory up to five processes INFOMATION *****\e[0m"
ps -eo %mem,%cpu,comm --sort=-%mem | head -n 6
echo ""
echo -e "\e[1;32mDone.\e[0m"

Copyright © Linux教程網 All Rights Reserved