When you press ctrl+r in the shell, you activate a feature called "reverse-i-search." Reverse-i-search'ing lets you search through your shell history commands, from most recent to oldest.