Lab Assignment
25 points total. You can get tonight's datafile from http://ccis2161.linux-classes.com/awk-mk2/secure
- Write an awk script which will display just names and comments (GECOS) from /etc/passwd
- Write an awk script to display only groupnames from /etc/group
- Write an awk script to show only filenames and sizes from the output of ls -al
- Write an awk script to display only the filename and number of hardlinks (in that order) from the output of an ls -al
- Write an awk script to display the only the username of any users which have /sbin/nologin as their shell
- Use awk to display only lines which contain "refused connect" from the provided 'secure' logfile
- Alter the above command to show only Month, date, time, and one instance of the IP address that attempted to connect
- Using a pipe, and sed, take the result of the last command, and delete all instances of '::ffff:'
- Use awk to show only a list of invalid users from the datafile
- Use awk to produce a list of usernames which successfully authenticated with publickey or password
- Now, take the previous question, and pipe the results to uniq, such that duplicates are removed
- Using nothing but awk, show only the first ten lines of /etc/passwd
- Using nothing but awk, show the seventh, eighth and ninth lines of the /etc/passwd file
- Using awk, show all lines from /etc/passwd which have a UID with a value less than 50
- Alter the previous question so that only usernames are displayed.