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.


1 visits (1 today, 1 this week, 1 this month, 1 this year)
Uptime: 06:40:03 up 5 days, 10:30, 2 users, load average: 0.08, 0.07, 0.07
216.73.216.119 GET from server z.lam1.us

Monday, November 24, 2025 @ 6:40:03 AM
z.ServerAdmin@lam1.us