What command will display the history of executed commands in a shell session?

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 that displays the history of executed commands in a shell session is "history." This command is built into most Unix-like shells, such as Bash. When you run the history command, it outputs a list of all commands that have been executed in the current shell session or in previous sessions, depending on the configuration. This is particularly useful for users who want to review their command inputs, reuse past commands, or troubleshoot issues based on their command history.

The other options do not perform this function: "log" is not a standard command for viewing history in the shell; "exec" is used for executing a command in place of the current shell process; and "show" isn't a recognized command for displaying command history in typical shell environments. Understanding the proper use of the history command can significantly enhance productivity and efficiency in command-line management.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy