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.


56 visits (1 today, 2 this week, 6 this month, 6 this year)
Uptime: 06:43:02 up 2 days, 17:38, 2 users, load average: 0.04, 0.03, 0.04
216.73.216.217 GET from server z.lamurakami.com

Wednesday, January 7, 2026 @ 6:43:02 AM
z.ServerAdmin@lamurakami.com