The shell remembers commands you’ve typed, making it easy to repeat or modify previous commands.
# Show command history
history
# Show last 10 commands
history 10
# Clear history
history -c
# Search history
history | grep keyword
# Previous command
!!
# Previous command with modification
!!:s/old/new/
# Command from history by number
!number
!150
# Last command starting with specific text
!text
!ls # Last command starting with 'ls'
# Previous command's last argument
!$

Next: → Command Line Editing
Previous: ← Environment Variables
Lesson Home: ↑ Lesson 3: History & Variables
Course Home: ⌂ Introduction to Linux