The history command is one of the essential utilities for the Linux administrator, usually used to track all the shell commands you execute in a series.When you execute the command, the shell captures it and then stores it in the separate file of the user’s home directory at ~/.bash_history. When the history command is executed, it fetches the data from this file and displays it as an output with the command and ID on the terminal screen.
Source: LXer – Display History with Date and Time in Linux