Recall & Review
beginner
What does the
history command do in Linux?The
history command shows a list of commands you have typed before in the terminal. It helps you see past commands to reuse or review them.Click to reveal answer
beginner
How do you search your command history interactively in Linux?
Press Ctrl + R to start a reverse search. Then type part of the command you want to find. The terminal will show matching commands from your history.
Click to reveal answer
intermediate
What does the command
!123 do in the Linux shell?It runs the command numbered 123 from your history list. This lets you quickly repeat a past command by its history number.
Click to reveal answer
beginner
Explain the use of
!! in the Linux shell.!! repeats the last command you typed. It is a quick way to run the previous command again without retyping it.Click to reveal answer
intermediate
How can you limit the number of commands shown by the
history command?Use
history | tail -n N where N is the number of recent commands you want to see. For example, history | tail -n 10 shows the last 10 commands.Click to reveal answer
Which key combination starts a reverse search in the Linux command history?
✗ Incorrect
Ctrl + R starts a reverse search to find commands in your history.
What does the command
!ls do?✗ Incorrect
!ls runs the most recent command that starts with 'ls' from your history.How do you repeat the last command you typed?
✗ Incorrect
!! repeats the last command entered.What does
history 5 show?✗ Incorrect
history 5 lists the last 5 commands you typed.Which command lets you run a command from history by its number?
✗ Incorrect
Using
!number runs the command with that history number.Describe how to search and reuse a previous command using the Linux history feature.
Think about interactive search and shortcuts to rerun commands.
You got /5 concepts.
Explain the purpose and basic usage of the
history command in Linux.Focus on how history helps with command reuse.
You got /4 concepts.