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.


6 visits (1 today, 6 this week, 6 this month, 6 this year)
Uptime: 12:24:20 up 23:59, 2 users, load average: 0.03, 0.05, 0.01
216.73.216.145 GET from server z.lam1.us

Friday, February 6, 2026 @ 12:24:20 PM
z.ServerAdmin@lamurakami.com