Install history command package
The history
command is a feature of bash. For some reason, Your system might be running dash instead of bash. Perhaps, you need to change your login shell to /bin/bash (should have been the default). Type the below command in terminal:
chsh -s /bin/bash
Then, log out and log in.
If you did not install bash in your system, you can install it by the command:
sudo apt-get install bash
Although, you can use other shell like zsh or tcsh (including history).
What you are referring to is bash
own history, which is typically saved in ~/.bash_history
file, and this functionality is embedded into bash
itself. No need to install additional packages.
Please have a look at this answer on how to check and enable bash
history.
Also, there is a chance that you are not using bash
, but some other shell. Use chsh
command to change your shell.