首頁 > 軟體

檢視Linux基本系統資訊

2020-06-16 17:43:12

檢視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"

本文永久更新連結地址http://www.linuxidc.com/Linux/2016-05/130899.htm


IT145.com E-mail:sddin#qq.com