bash学习
<span style="font-size:18px;">#!/bin/bash
#The name of the user, the user ID, the host name of the machine and the machine
#type.
echo "hostname"
hostname
echo "userid"
id
echo "hosttype"
set |more
df
cat /proc/cpuinfo
cat /proc/meminfo
#List the CPU model name; the CPU speed and the CPU cache size.
free
#List the number of processes running on the system.
ps aux
pid=$(ps aux |sort -g -r -k3 |head -1 |awk '{print$2}')
cpuuse=$( ps aux |sort -g -r -k3 |head -1 |awk '{print$3}')
if [ cpuuse>60 ]
then
kill -9 $pid
fi
</span>