Which command will show you the last activity in your terminal session?

Prepare for the LPI Linux Essentials Exam. Study with flashcards and multiple choice questions, each with hints and explanations. Get exam-ready!

The command that shows the last activity in your terminal session is the one that displays a list of commands that have been executed in the current shell session. The "history" command retrieves this information and presents it in a list format along with each executed command's number. This is particularly useful for recalling previously input commands directly in your terminal.

Using the "history" command provides a quick way to access your command history, including the most recent command activity, without needing to specify a file or paging through output. It essentially functions as a built-in feature of the shell, making it accessible and practical for users who wish to navigate their previous actions.

Other options, while related to retrieving command history, do not provide information in the same way. For instance, "tail ~/.bash_history" shows only the last few lines of the history file, "cat ~/.bash_history" displays the entire contents of the history file, and "more ~/.bash_history" pages through that same file. However, these commands do not filter the output to show the most recent commands actively used in the current session, making the "history" command the most direct and effective choice for this task.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy