You can see your command history on Linux just using command history:
and this should show you all commands which you have wrote with a line number on the beginning of the line.
You can redo those commands just with ! and writing number of that line which command you want to redo:
add date and time to history list:
export HISTTIMEFORMAT='%d/%m/%Y %H:%M:%S '
or finnish way:
export HISTTIMEFORMAT='%d.%m.%Y %H:%M:%S '
Ofcourse you can use grep with history example like this:
and get only line which has apt-get on them.
If you think that your history list is too short or too long just say:
and you will see how long your history file is and if you want to change it just say:
at the command line to set your history size to 1000 lines.
If you just want to run again last command just do:
Continue reading Linux: History command