Unix systems store the commands you type. To get a chronological list of commands you typed, use the following command:
$ history
To repeat a previous command you can type:
$ !!
To repeat a previous command
$ !n (where n is a number from your history list)
or
$ !string (where string is a series of characters)
This would repeat the most recent command in your history whose first characters match string. If you do not want the command to be executed, you could use the following command.
$ history | grep 'scp'
would return all entries where scp command was used. None of these commands would be executed.
Examples
$ !12
$ !mys
$ history | grep 'make'