- 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 ksh Shell
ksh is another shell that offers command completion. You type part of a command, press twice, and ksh completes the command for you (see Code Listing 3.12). Using command completion in ksh isn't as easy as it is in zsh or bash, but the results are the same.
Code Listing 3.12. After listing the files and directories, we set our options, then successfully completed a command. The ^[^[ is how appears on the screen when the shell doesn't know to use it to complete commands.
$ ls Complete NewProject bogus2 files → public_html testme Completed News chat.conf → ftp puppy Mail access dead.letter → mail temp $ cd pub^[^[ ksh: pub: not found $ set -o emacs $ cd public_html/ $
To use completion in the ksh shell:
-
set -o emacs
To begin, you must enable command completion by entering set -o emacs. This command enables command completion and sets it to use emacs commands. (Emacs is an editor, but you do not need to use or be familiar with it to recycle ksh commands.)
-
ls -l
Use ls -l to list the files in your current directory. You do this so you know which directory (public_html) you can change to in step 3.
-
cd pub
Type in a partial command. In this example, we typed the cd command and part of the public_html command (truncated to pub).
Press two times to complete the command. (Depending on your terminal emulation, you might need to use twice instead of twice.)