nerdexam
LPI

010-160 · Question #9

Which of the following outputs could stem from the command last?

The correct answer is E. root pts/0 192.168.1.1 Mon Feb 3 10:48 still logged in. The last command reads /var/log/wtmp to display a history of user logins, showing username, terminal, source IP, date/time, and session status.

Security and File Permissions

Question

Which of the following outputs could stem from the command last?

Options

  • A/ is
  • Bcd text.txt
  • Clogout
  • Dreboot system boot 4.15.0-60-generic Mon Feb 3 09:20 - 11:39 (02:19)
  • Eroot pts/0 192.168.1.1 Mon Feb 3 10:48 still logged in

How the community answered

(57 responses)
  • A
    5% (3)
  • B
    2% (1)
  • D
    2% (1)
  • E
    91% (52)

Why each option

The `last` command reads /var/log/wtmp to display a history of user logins, showing username, terminal, source IP, date/time, and session status.

A/ is

'/ is' resembles a fragment of `ls /` filesystem listing output, not any field produced by the `last` command.

Bcd text.txt

'cd text.txt' is a shell command invocation typed by a user, not output generated by any Linux command.

Clogout

'logout' alone is not a complete output line from `last`; logout events appear as part of a full record containing username, terminal, host, login time, and logout time.

Dreboot system boot 4.15.0-60-generic Mon Feb 3 09:20 - 11:39 (02:19)

Although `last` does display reboot pseudo-entries, this option's format embedding the kernel version string does not represent a user-session login record, which is the primary output type the question targets.

Eroot pts/0 192.168.1.1 Mon Feb 3 10:48 still logged inCorrect

The entry 'root pts/0 192.168.1.1 Mon Feb 3 10:48 still logged in' matches the exact columnar format that `last` produces: username, pseudo-terminal, source IP or hostname, login timestamp, and session status. The 'still logged in' field is the standard indicator `last` appends when a session has not yet terminated.

Concept tested: Interpreting output of the last login command

Source: https://man7.org/linux/man-pages/man1/last.1.html

Topics

#last command#login history#user sessions

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice