$history
Display the list of previously executed terminal commands.
history [OPTIONS]Try `history` Live in Interactive Sandbox
Zero-install client simulation with real-time feedback.
Overview & How history Works
`history` shows the shell history list with line numbers. It allows users to review previous commands, audit actions, or re-run previous commands using the `!n` event recall syntax.
Common Flags & Command Options
| Flag / Option | Description |
|---|---|
| -c | Clear the history list in the current session. |
| -d [OFFSET] | Delete the history entry at position OFFSET. |
| [N] | List only the last N commands. |
Practical Real-World Examples
historyOutputs the chronological list of commands executed in the session.
Frequently Asked Questions
How do you quickly re-run the last executed command?
Type `!!` and press Enter to execute the previous command, or `!grep` to re-run the most recent command starting with grep.
Related Linux Commands
Report a snapshot of currently running system processes.
Display real-time Linux processes and system resource utilization.
Interactive process viewer with colorful CPU meters and mouse support.
Send termination or control signals to processes by PID.
Print the effective username associated with the current shell session.
Display or set system date and time.