history [number]Arguments explained
- number limits how many entries are printed in many shells.
- -c clears history in Bash.
Common examples
history 20Displays the last 20 recorded commands.
Press Ctrl+R, then type part of a commandReverse-searches command history in many shells.
| Field | Details |
|---|---|
| Command | history |
| Category | Shell and Environment |
| Primary use | Shows previous shell commands. |
| Syntax | history [number] |