Command History

If you type a command and you don’t
get it right, or if you just want to recall something that you’ve used
before, try using the up arrow key. The shell keeps a history of
commands that you’ve run so you can walk back through
them using the arrow keys. Then you can edit a previous
command line that you’ve used and maybe get some more success. There are a couple of other ways
to access the shell history. One of them you’ve seen
is the command history, which prints out the whole history. This doesn’t just include history
from the current shell session, you can also see commands
you ran in the past. Another one is the keystroke control R. This is a special function, called reverse i search, which let’s
you search your shell history. This is awfully handy if you used some
command long ago or just yesterday and it’s long command and
you want to recall it now. Oh, that was that command we ran. Great.

Comments 1

Leave a Reply

Your email address will not be published. Required fields are marked *