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.


2 visits (1 today, 2 this week, 2 this month, 2 this year)
Uptime: 08:26:15 up 1 day, 46 min, 2 users, load average: 0.03, 0.03, 0.00
216.73.216.47 GET from server z.lamurakami.com

Saturday, August 23, 2025 @ 8:26:15 AM
z.ServerAdmin@lam1.us