The line numbers from less -N .bash_history
and wc -l .bash_history
have 44 more lines than the line numbers shown by the bash built-in command history
. Comparing the last 20 entries in the history list displayed by history
against the last 20 entries in the history file displayed by less
shows that those commands are the same, which rules out duplicate commands as the reason, so what is causing the different line numbers between the history command and wc or less?
I initially assumed that the history command simply counted the commands in the history file but the different results with less -N
or wc -l
indicate this is not the case