#=============================================== #Exercise #2 sample Answer exercise02commands.sh #=============================================== # #Student Name: Ben Dover #Algonquin EMail Address: abcd0001 #Student Number: 074-210-779 #Course Number: DAT2330 #Lab Section Number: 014 #Professor Name: Ian Allen #Assignment Name/Number/Date: Exercise #2 due February 3, 2004 #Comment: one of two files # show the current date and time date # show the current working directory pwd # show the system date and time in upper case date | tr '[a-z]' '[A-Z]' # show only the time (4th field) from the system date and time date | awk '{print $4}' # show a simple count of the number of logged in users who | wc -l # checksum the last 5 lines of sorted password file sort /etc/passwd | tail -5 | sum # show "reboot" occurances in listing of last logged in users last | grep "reboot" # show the top 20 hosts (not reboot) in descending order by number of logins last -a | grep -v "reboot" | awk '{print $10}' | sort | uniq -c | sort -nr | head -20