Using Shell History
To become skilled at the command line, you have to use it regularly. There are no shortcuts to becoming comfortable, but there are a few high-value tricks that you can learn early on, which will save you time and frustration. The earlier you build them into your muscle memory, the better.
In this chapter, you’ll learn how to leverage your shell history to avoid the tedious re-typing of commands you’ve already run. You’ll also see how to customize your shell’s behavior or appearance via the shell configuration file. Finally, we’ll show you the most useful shortcuts to edit and modify commands at the command prompt. All in all, this chapter will make you blazing fast on the command line.
We will go about this by covering the following topics:
- Shell history
- Executing previous commands with
!
- Jumping to the beginning or end of a line
Let’s begin by understanding shell history.