4

This is what I see in my terminal in a fresh session:

Agent pid 6847
Identity added: /home/eric/.ssh/id_rsa (/home/eric/.ssh/id_rsa)
➜  ~  history
    1  history
➜  ~ 

I'm using Linux Mint 17.3 64 bit and oh-my-zsh (ZSH shell).

This machine is newly set up.

This has never happened to my previous Fedora, Ubuntu or OS X machines.

What can I do so that history show more than current session - that should be the purpose of the history command in the first place right?

Kusalananda
  • 333,661
ericn
  • 213

1 Answers1

1

Read you shell's manual to figure out how to configure persistent command line history.

In most shells, this is accomplished by setting the shell variable HISTFILE to the name of a file. For example:

HISTFILE=$HOME/.shell_history

Bash uses ~/.bash_history as the default history file, ksh93 has no default (according to its manual), nor does zsh.

The zsh manual has long sections on various options and variables that influences how and when the command line history is saved and used, but the most important bit is to make sure that HISTFILE is set to the pathname of a writable file.

Related question: Command history in Zsh

Kusalananda
  • 333,661