The shell keeps track of commmand you issued.
follow these steps to learn:
1. type this at the shell:
history
a list of the command you have executed will be displayed, with a number next to each command you can tell the shell to rerun an earlier command based on tis number or based on tis name
now try this
!d
or
r d
the last command that began witht he letter d is executed
these could be some great time savers (shorcuts) if you get used to them.