Problem scenario
When you press the up arrow on the keyboard you see " ^[[A". You want to see the previous command that was entered. How do you enable history at the command line?
Solution
Root cause: The /etc/passwd file has an entry like this:
cooluser:x:1001:1002::/home/cooluser:
(This could be caused if you created the user quickly with a useradd command.)
Procedures
Run this command: sudo cat /etc/passwd | grep $(whoami)
Do you see a /bin/bash at the end? If not you need to modify the /etc/passwd file to have a /bin/bash at the end of the stanza for your user having the problem. This is how it should look when you are done:
cooluser:x:1001:1002::/home/cooluser:/bin/bash
# replace "cooluser" with the name of the user you want to change the behavior of the up arrow for.
You have to log out and log back in for the changes to take effect.