When.

DRAG DROP
You have been asked to parse a log file of logins to determine various information about who is logging in and when.
INSTRUCTIONS
Open and inspect the Login log file.
Drag and drop the correct commands onto the output that was generated from that command.
Tokens can be used only once and not all will be used.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
Select and Place:

comptia-exams

0 thoughts on “When.

  1. 3. awk ‘(print $1)’ lastlog | sort | uniq —— the output only shows the first field (awk $1 because $0 is the whole line), it’s sorted and eliminated duplicates so uniq. No -c because there’s no count displayed.

  2. 2. grep -i “mar 12” lastlog | sed ‘s/[a-z]/[A-Z] /g’ —– You’ll notice 2 things relevant to this output the date is the 12th and there’s a lot of capital letters. I think there is an error in the output because Sun and MAR should be capitalized. Regardless, grep for mar 12 occurs first but with the -i option it will find all instances, as it has. Then the sed command will subsitute (s) the regular expression ([a-z] all alphabetic lowercase characters) with the replacement (([A-Z] all alphabetic uppercase characters) and it does this globally (g). It cannot be tr because the syntax is wrong by using the double quotes AND it should have convert the Mar to MAR as well. Regardless both are wrong, grep|sed is less wrong.

  3. 1. grep “Mar 13” lastlog ——- It’s not any of the awk commands, There’s clearly a space between Mar and 13 and there should be a double quote. Man page shows file comes after options and patterns. Not capitalized and not sorted. Easy one to warm us up.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.