Let us create a simple BASH script that provides information regarding your Linux system which includes:
#!/bin/bash
clear
echo “This information is brought to you by $0.”
#Welcome the user
echo “Welcome, $USER”
echo
echo “Today is `date`.”
echo
#Currently active users.
echo “Following users are presently active:”
w | cut -d ' ' -f 1 | grep -v USER | sort -u
echo
#System information using uname command
echo “This is `uname -s` running on a `uname -m` processor.”
echo
#Information of uptime
echo “Following is the uptime information:”
uptime
echo
#Showing free memory
echo “Memory Details:”
free
echo
#Disk space usage using df command
echo “Disk Space Utilization:”
df -mh
echo
- [b]Active Users[/b]
- [b]Uptime[/b]
- [b]Load average[/b]
- [b]Free and Used Memory[/b]
- [b]Disk Space Utilization[/b]
#!/bin/bash
clear
echo “This information is brought to you by $0.”
#Welcome the user
echo “Welcome, $USER”
echo
echo “Today is `date`.”
echo
#Currently active users.
echo “Following users are presently active:”
w | cut -d ' ' -f 1 | grep -v USER | sort -u
echo
#System information using uname command
echo “This is `uname -s` running on a `uname -m` processor.”
echo
#Information of uptime
echo “Following is the uptime information:”
uptime
echo
#Showing free memory
echo “Memory Details:”
free
echo
#Disk space usage using df command
echo “Disk Space Utilization:”
df -mh
echo