Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
UNIT 4
The bash Shell
Rev RH033-RHEL3-1
UNIT 4: Objectives
Learn about available shells
Learn command line shortcuts
Learn how the command line is
expanded and how to inhibit expansion
of special characters
Rev RH033-RHEL3-1
UNIT 4: Agenda
Shell heritage
Command line shortcuts
Command line expansion
Inhibiting command line expansion
History and editing tricks
Rev RH033-RHEL3-1
bash Introduction
"Bourne Again Shell"
Developed for the GNU Project
The de facto standard Linux shell
Backward-compatible with Bourne shell
(sh) - the original (standard) UNIX shell.
Rev RH033-RHEL3-1
bash Heritage
Bourne Shell (sh) - Original UNIX shell
written by Steven Bourne at AT&T
C Shell (csh)- Written by Bill Joy at
UC Berkeley
Added many features such as command
completion, history and job control
Rev RH033-RHEL3-1
Rev RH033-RHEL3-1
Rev RH033-RHEL3-1
Rev RH033-RHEL3-1
Examples:
$
$
$
$
Rev RH033-RHEL3-1
xboa<TAB>
xboard
ls myf<TAB>
ls myfile.txt
Copyright 2003 Red Hat, Inc.
1
0
Rev RH033-RHEL3-1
1
1
Rev RH033-RHEL3-1
Curly braces: { }
A string is created for every pattern inside
the braces regardless if any file exists
$ rm hello.{c,o}
1
2
Rev RH033-RHEL3-1
Arithmetic - $[ ]
Substitute result of arithmetic expression in
a command line
$ echo Area: $[ $X * $Y ]
1
3
Rev RH033-RHEL3-1
1
4
Rev RH033-RHEL3-1
History Tricks
Use the up and down arrow keys to scroll
through previous commands
Type <CTRL-R> to search for a command in
command history.
(reverse- i-search)`':
1
6
beginning
<Esc>b
<Ctrl-u>
<Ctrl-k>
Rev RH033-RHEL3-1
End of Unit 4
Questions and answers
Summary
1
9
Rev RH033-RHEL3-1