Question

On an OSX system, ZSH shell and iterm2 terminal, I am running:

$history

Results are the 10 last commands.

How do I increase the default number of returned lines?

I can do

$history -20

And probably also alias this to history, but I do wonder if there is some setup to control this natively. Also, please do not confuse with HISTSIZE, which is a separated configuration.

Was it helpful?

Solution

There does not seem to be such configuration available.

Option is simply:

alias history="history -30"

OTHER TIPS

Just wrap the history command into a function:

h () { history ${1:-\-30} }

You get the last 30 history entries by default and still have the option to change the argument to another value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top