Preliminary Exercises

2.2. Preliminary Exercises

  1. System administrators often write scripts to automate common tasks. Give several instances where such scripts would be useful.

  2. Write a script that upon invocation shows the time and date, lists all logged-in users, and gives the system uptime. The script then saves this information to a logfile.


100 visits (1 today, 6 this week, 17 this month, 100 this year)
Uptime: 08:07:07 up 17:01, 2 users, load average: 0.20, 0.34, 0.31
216.73.217.30 GET from server z.larryforalaska.com

Friday, September 11, 2026 @ 8:07:07 AM
z.ServerAdmin@lamurakami.com