Show the most recent 20 commands.
history 20Show commands recorded by your shell in the current history list.
history [N] | history [-c] | history [-d OFFSET]Show the most recent 20 commands.
history 20Show the last ten displayed history lines.
history | tail -n 10| Option / clause | Description |
|---|---|
N | Show the most recent N history entries. |
-c | Clear the in-memory history list. |
-d OFFSET | Delete the history entry at OFFSET. |
-a | Append new entries from this session to the history file. |
-r | Read the history file and append its contents to the list. |
-w | Write the current list to the history file. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.