Novell SuSE Linux Professional 9.2 Upgrade [Strong Encryption 128 Bit] 00662644457260 ユーザーズマニュアル

製品コード
00662644457260
ページ / 324
21
W
or
king
with
the
Shell
21.1.3
Bash Functions
There are two important functions of the shell that can make your work a lot eas-
ier:
The history function — To repeat a command that has been entered before,
press




until the previous command appears at the prompt. Move forward
through the list of previously entered commands by pressing




. To edit the
command line, just move the cursor to the desired position using the arrow
keys and start typing. Use




Ctrl
-




R
to search in the history.
The expansion function — Expand a file name to its full length after typ-
ing its first letters until it can be uniquely identified. To do so, type the first
letters then hit




Tab
. If there are several file names starting with the same
letters, obtain a list of them by hitting




Tab
twice.
First Example: Managing Files
Now that you know what a command looks like, which directories exist in SUSE
LINUX, and how to speed up things when using Bash, put this knowledge into
practice with a small exercise.
1. Open a console from the KDE desktop by clicking the shell icon.
2. Enter the
ls
command to see the contents of your home directory.
3. Use the command
mkdir
(which stands for make directory) to create a new
subdirectory called
test
by entering
mkdir test
.
4. Now launch the KEdit editor by pressing




Alt
-




F2
and entering
kedit
in the
input field. Type a few letters in the editor then save the file as
Testfile
in your home directory. Linux distinguishes between uppercase and lower-
case. For this example, use an uppercase T.
5. View the contents of your home directory again. Instead of typing
ls
again,
just press




twice and the
ls
command should reappear at the prompt. To
execute the command, hit




Enter
. The newly created directory
test
should
appear in blue letters and
Testfile
in black. This is how directories and
files can be distinguished in a console.
259
SUSE LINUX