Chapter 13

  1. Use the lastlog command
$ lastlog | awk ' /Never logged/ { print $1}'
  1. Use the wc command
$ lastlog | awk ' /Never logged/ { print $1}' | wc -l
  1. Zero. Because the line ends with two asterisks.

Get Mastering Linux Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.