
When you get ‘stuck’ in the search mode you can leave it with ctrl-G. So ctrl-R and then typing cd will recall the last cd command you typed. This will search through the history backwards and recall the latest command you used starting with what you typed. Instead of hitting the up arrow several times, you can also hit ctrl-R and start typing a command you used before. You can also hit the down arrow to move forward again. You can hit the up arrow multiple times to go back further in your command history. Hitting the up arrow will recall the previous command, leaving the cursor at the end of the line, so you can either hit return to execute the command or edit it. Often you want to retry or re-use a previous command.

These key commands are for the default Terminal configuration with the bash shell. Sometimes you have to move the cursor around the prompt line and there are more efficient ways of doing this than hitting the left arrow multiple times.


One the most basic elements of a command shell is the prompt line, where you enter the command. I have talked a lot about the Terminal recently.
