cmdxray / commands / history

What does history do?

display or manage the shell command history (shell builtin).

▸ Explain your own history command →

history examples, explained

$ history

  • historydisplay or manage the shell command history (shell builtin)

$ history 20

  • historydisplay or manage the shell command history (shell builtin)
  • 20an argument passed to the command

$ history -c

  • historydisplay or manage the shell command history (shell builtin)
  • -cclear the entire history list

$ history -w

  • historydisplay or manage the shell command history (shell builtin)
  • -wwrite the current history out to the history file

history flags & options

-cclear the entire history list
-ddelete the history entry at this position
-aappend the new history lines to the history file
-rread the history file and append it to the current list
-wwrite the current history out to the history file
-nread the history lines not already read from the file

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.