history Command Generator
Display or manipulate shell command history
Getting Started with history
## What is history?
The `history` command displays and manipulates the shell's command history — the numbered list of commands you have run in the current (and past) sessions. You can review recent commands, repeat them, delete entries, or sync the in-memory list with the history file.
## How to Use
1. **Show Recent Commands**: Leave options empty to list the full history, or set an offset (e.g., `20`) to show only the last N entries. 2. **Choose an Action**: Clear the list (`-c`), delete an entry (`-d`), or read/write the history file (`-a`, `-w`, `-r`, `-n`). 3. **Copy & Run**: Paste the generated command into your terminal.
Common Options
### Offset (positional)
Pass a number to show only the last N entries: `history 20`.
### `-c` Clear
Delete the entire in-memory history list. Note: this does not erase the history file unless followed by `history -w`.
### `-d offset` Delete
Remove a single entry by its history line number: `history -d 10`.
### `-a` Append
Append new (not-yet-written) history lines from the current session to the history file.
### `-w` Write
Overwrite the history file with the current in-memory list — useful to persist a `-c` clear.
### `-r` Read
Read the history file and append its contents to the in-memory list.
### `-n` Read unread
Read only the lines appended to the history file by other sessions since the last read.
▶How do I permanently clear my command history?
▶How do I re-run a previous command without retyping it?
▶How do I delete a single bad command from history?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee