Which command is used to display event messages from the /var/log/wtmp log file?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command used to display event messages from the /var/log/wtmp log file is "last." This command reads the wtmp file, which records all logins and logouts on the system. By executing "last," users can retrieve a history of user sessions, including the time of login and logout, the terminal used, and the hostname or IP address of the remote machine if applicable. This command provides valuable information for auditing user activity on the system.

While "lastb" is similar, it specifically displays failed login attempts, drawing its information from the /var/log/btmp file, not from the wtmp. "logread" is utilized to read system log messages, but it does not directly interact with the wtmp file. Additionally, "wtmp" does not function as a command in this context; rather, it refers to the name of the file itself. Therefore, "last" is the appropriate choice for displaying the contents of /var/log/wtmp.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy