Multiple choice technology operating systems

who | awk ‘{ print $1, $5 }’

  1. Error : syntax used with awk is wrong.

  2. prints names of logged-in users and time of login.

  3. Display output of who with $1 and $5 at the end.
  4. None of the above.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Unix/Linux, the who command outputs details about logged-in users. Piping this to awk to print the first column (\$1) and fifth column (\$5) extracts the username and the login time, respectively. The syntax is correct and will not cause an error.