Skip to Content
Navigation:

A stick figure smiling

If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript".

browse more comics! get the zine!
read the transcript!

your shell has a history of the commands you ran

some ways to access history:

  • press the up arrow
  • run history
  • search it with Ctrl-R (in bash/zsh)

how long does your shell store history for?

(sad face) in bash, the default is 500 commands (not enough!)

(happy face) in fish, the default is 256,000 commands

if you’re using bash, you might want to configure it to store more history

when does your shell save history?

by default, bash and zsh only save history to a file when you exit the shell

fish saves the history continuously

where is history stored?

bash: .bash_history

zsh: run echo $HISTFILE

fish: mine is in ~/.local/share/fish/fish_history

smiling stick figure with curly hair (thinking): “sometimes I copy over my shell history when setting up a new computer!”

a useful history tool: atuin

atuin lets you:

  • save unlimited history
  • search history more easily
  • save commands as soon as you run them
  • sync your history (optionally)

gotcha: history in zsh only shows 15 entries

You can run history 0 to see all the history

panel 7

commands that start with a space don’t go in your history. good for passwords!

(might depend on your shell’s config)

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)