- Discovering What Shell You're Using
- Understanding Shells and Options
- Changing Your Shell with chsh
- Changing Your Shell Temporarily
- Using Completion in the bash Shell
- Viewing Session History in the bash Shell
- Using Completion in the zsh Shell
- Viewing Session History in the zsh Shell
- Using Completion in the ksh Shell
- Viewing Session History in the ksh Shell
- Viewing Session History in the csh Shell
- Changing Your Identity with su
- Fixing Terminal Settings with stty
- Exiting the Shell
Using Completion in the bash Shell
One of the cool features of the bash shell is command argument completion, with which you can type just part of a command, press , and have bash complete the command for you (Code Listing 3.8).
Code Listing 3.8. In this example, we typed only the ls command followed by "cd pub" and pressed the key; bash completed the command for us.
bash-2.00$ ls Complete NewProject bogus2 → ftp puppy Completed News dead.letter → mail temp Mail access files → public_html testme bash-2.00$ cd public_html/ bash-2.00$
To use completion in the bash shell:
-
ls -l
Use ls -l to list the files in your current directory.
-
cd pub
Type in a partial command, then press to complete the command. In this example, we typed the cd command and part of the public_html directory (truncated to pub in the example), then pressed to complete it (see Code Listing 3.8).