HISTORY(1)

NAME

history - list, search, or delete command history entries.

SYNOPSIS

history [n]
history list [n]
history search text ...
history delete --id n ...
history clear

DESCRIPTION

history is a Rush-specific regular builtin for managing interactive command history. It is not available in POSIX mode; use fc for portable history access.

Every listed or matched entry is printed with its history id followed by a tab and the command text. Ids are stable identifiers, so an id printed by history search can be passed to history delete --id.

SUBCOMMANDS

history [n], history list [n]
List the most recent n entries. The default is 16.
history search text ...
List every entry whose command contains text as a case-insensitive substring. Multiple operands are joined with single spaces into one query. Unlike interactive reverse search, no duplicate hiding is applied: every matching entry is listed with its id so any of them can be deleted.
history delete --id n ...
Delete the entries with the given ids. --id n and --id=n are both accepted and may be repeated. Ids that do not name an entry are reported on standard error and the remaining ids are still processed.
history clear
Delete all history entries.

NOTES

Rush stores history in $XDG_STATE_HOME/rush/history.sqlite, falling back to $HOME/.local/state/rush/history.sqlite.

history invocations are not recorded in history. Searches would otherwise match their own command line, and history clear would leave itself behind as the sole entry.

Deleting an entry removes it from arrow-key navigation, reverse search, autosuggestions, and z frecency ranking alike, because all of them read the same history store.

Commands submitted with a leading space are never recorded, so secrets can be kept out of history without needing deletion afterward.

EXIT STATUS

history returns zero on success. It returns 1 when history is not active, an operation is unavailable, or an id does not name an entry, and 2 on usage errors.

SEE ALSO

rush-builtins(7), fc(1), z(1).