#!/bin/bash#clear console
clear#just echo welcome messages
echo “This is information provided by $0 . Program starts now.”echo “Hello, $USER”echo#print today’s date
echo “Today’s date is `date`, this is week `date +”%V”`.”echo#list of currently loged user via w command.
echo “These users are currently connected:”w | cut -d ” ” -f 1 – | grep -v USER | sort -uecho#info about system with command uname and keys -m and -s
echo “This is `uname -s` running on a `uname -m` processor.”echo#info about uptime, using uptime command
echo “This is the uptime information:”uptimeecho#info about free memory via free command
echo “Free memory:”freeecho#info about disk usage
echo “Disk usage:”df -khecho
Output
Below is the script output.
This is information provided by ./system_info.sh . Program starts now.Hello, yevhenToday’s date is Sunday, March 3 2013 22:31:43 +0200, this is week 09.These users are currently connected:yevhenThis is Linux running on a i686 processor.This is the uptime information:22:31:43 up 1:24, 2 users, load average: 0.45, 0.18, 0.07Free memory:total used free shared buffers cachedMem: 3374792 1589476 1785316 0 96720 725652-/+ buffers/cache: 767104 2607688Swap: 4192924 0 4192924Disk usage:Filesystem Size Used Avail Use% mounted
/dev/sda1 42G 5,5G 35G 14% /tmpfs 1,7G 0 1,7G 0% /lib/init/rwudev 1,7G 168K 1,7G 1% /devtmpfs 1,7G 160K 1,7G 1% /dev/shm/dev/sda6 184G 26G 149G 15% /home
No comments:
Post a Comment