Typing Shortcuts
If you’ve been following along this tutorial at the terminal, you may be tired of typing the same things over and over again. It can be particularly annoying when you make a mistake and have to start over again. Here is where the shell really makes life easier. It doesn’t make Unix as simple as a point-and-click interface, but it can help you work really fast in a command environment.
This section discusses command-line editing. The tips here work if your shell is bash, ksh, tcsh, or zsh. Command-line editing treats the last fifty or so lines you typed as a buffer in an editor. You can move around these lines and change them the way you’d edit a document. Every time you press the Return key, the shell executes the current line.
Word Completion
First, let’s try something simple that can save you a lot of time. Type the following, without pressing the Return key:
$ cd /usr/inc
Now press the Tab key. The shell will add lude to complete the
name of the directory /usr/include. Now you can press the
Return key, and the command will execute.
The criteria for specifying a filename is “minimal completion.” Type just enough characters to distinguish a name from all the others in that directory. The shell can find the name and complete it—up to and including a slash, if the name is a directory.
You can use completion on commands too. For instance, if you type:
$ emaand press the Tab key, the shell will add the cs to make emacs (unless some other command in your path begins ...