Please see man history
for more details:
DESCRIPTION
Many programs read input from the user a line at a time. The GNU History library is able to keep track of those lines, associate arbitrary data with each line, and utilize information from previous lines in composing new ones.
HISTORY EXPANSION
The history library supports a history expansion feature that is identical to the history expansion in bash. This section describes what syntax features are available.
History expansions introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly.
History expansion is usually performed immediately after a complete line is read. It takes place in two parts. The first is to determine which line from the history list to use during substitution. The second is to select portions of that line for inclusion into the current one. The line selected from the history is the event, and the portions of that line that are acted upon are words. Various modifiers are available to manipulate the selected words. The line is broken into words in the same fashion as bash does when reading input, so that several words that would otherwise be separated are considered one word when surrounded by quotes (see the description of history_tokenize() below). History expansions are introduced by the appearance of the history expansion character, which is ! by default. Only backslash () and single quotes can quote the history expansion character.
Event Designators:
An event designator is a reference to a command line entry in the history list. Unless the reference is absolute, events are relative to the current position in the history list.
Now, to answer your question! Here are the directories, where your bash-history is saved. And YES, there is the command history, that you can access in terminal with ⇥-key located:
~/.bash_history
/root/.bash_history
You can use cat ~/.bash_history
, to see the listing/content of previous used commands. You can also open the ".bash_history", with gnome-open ~/.bash_history
, in order to edit the list, or rm ~/.bash_history
, to [rm=remove] the history (".bash_history" will be autogenerated, so it is save to delete it).
sudo apt-get install xxxx
then is when terminal is telling you what is doing, it asks for confirmation, for installing aditional packages, etc.