I typed in the history command and it showed me the last 10 commands executed by me. Now I wanted to see the last 20 commands executed by me so (after reading the documentation):
An argument of n lists only the last n lines.
I typed in history 20
. This showed me all the commands starting from command number 20 to the current command which was somewhere around 2000. So I tried
history -20
and this works. It shows me the last 20 commands. But this is not what is said in the documentation.
Also history -d [offset]
is supposed to delete the command on that offset. Even that does not work in my zsh.
This is straight out of my zsh shell :
Best Answer
In zsh,
history
is an alias forfc -l 1
, so when you dohistory -20
it get replaced byfc -l 1 -20
which just won't work, so instead usefc
directly:and you'll be fine.