Commonly Used Shell Features

By default, when you use the command line on a SUSE system, you are using the bash shell. If you have not used bash or a similar shell much in the past, and particularly if you have bad memories of the DOS command line, you may not realize just how powerful working at the command line can be. Experience shows that people who come to Linux from a Windows background tend to start by trying to use graphical tools (for example, copying files by dragging them from one Konqueror window to another) but gradually realize that the command line is both a quicker and easier way to perform many tasks.

The bash shell provides a powerful command-line interface that offers many features that the DOS command line lacks. The most important of these are command history and command completion:

■ Command history: You can see a history of the commands you typed by pressing the up arrow key repeatedly. You can then edit the command and reuse it.

■ Command completion: If you type part of a command and then press the Tab key, bash will complete the command as far as it is able to do so uniquely.

These two features taken together make working with the shell extremely quick and easy with a little practice. The command history is also searchable in more than one way: If you type the command history, you will see a listing of the last commands you have typed. Each of these is numbered: If you type ! followed by the number of the command, you can run it again. If you press Ctrl+R (hold down the Control key and press R), you can search the command history by typing part of the command you are looking for. If the first command that appears is not the one you had in mind, repeat the Ctrl+R until it appears. You can also repeat a previous command by typing ! followed by the first letter or letters of the previous command.

Was this article helpful?

0 0

Post a comment