Skip to content

Instantly share code, notes, and snippets.

@ChristopherA
Last active July 16, 2023 20:28
Show Gist options
  • Save ChristopherA/9fb2dc646cce1e1a68f3e977c64b984d to your computer and use it in GitHub Desktop.
Save ChristopherA/9fb2dc646cce1e1a68f3e977c64b984d to your computer and use it in GitHub Desktop.
CLI `history` tips

BASH

Clear All

history -c

ZSH

Clear All

The equivalent to history -c on zsh is

history -p

However, it will leave the history command itself in the history.

Delete Last Entry from History

No easy way to do this:

Some advice in:

There is an fc command which I've not explored yet, and this has been suggested:

fc -e : -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment