Red Hat ENTERPRISE LINUX 4 - STEP BY STEP GUIDE Manual page 63

Table of Contents

Advertisement

Chapter 4. Shell Prompt Basics
Commands that you only typed partially and did not follow with [Enter] are not saved into your
command history file. To clear your command history, type history -c.
By default, Red Hat Enterprise Linux stores 1000 commands. Each terminal window or shell prompt
stores a separate set of commands. If you gain root privileges by using the command su -, the history
file (and thus the commands) you access are root's, not the user's.
4.3.4.3. [Ctrl]-[Z] and running processes in the background
Applications and processes can be started from the command line. When an application starts from
the command line, that particular shell is taken up with standard output for that application until the
application closes. The screen fills with gibberish or messages that can be ignored. To continue to
use the current shell while running an application from the same shell, add the ampersand, "&", to
the end of the command line. For example, oowriter & starts OpenOffice.org Writer and allows
you to continue entering commands on the command line. This is known as running a process in the
background.
If you have started an application or process and forgotten to add the &, first press [Ctrl]-[Z] — this
suspends the application. To allow it to continue running without displaying standard output, type bg
and press [Enter]. This is referred to as running the application in the background.
4.3.4.4. Wildcards
Wildcards are place holders used to allow users to search for or use multiple files with similar names.
The subject of wildcards is part of the larger subject of regular expressions. Two of the most common
wildcards are "*" and "?".
The asterisk, "*", represents any character or string of characters. The entry a*.txt could refer to
as well as
ab.txt
aardvark.txt
The question mark represents a single character. The entry a?.txt could refer to
, but not
a1.txt
aardvark.txt
What if you forget the name of the file you are looking for? Using wildcards or regular expressions,
you can perform actions on a file or files without knowing the complete file name. Type out what you
know, substituting a wildcard for the remainder.
Tip
To read more about wildcards and regular expressions, take a look at the
You can save the file to a text file by typing
and read the file with
be aware that it is quite long.
For example, to find a file called "sneaksomething.txt," enter:
ls sneak*.txt
The shell lists every file that matches that pattern:
sneakers.txt
Regular expressions are more complex than the straightforward asterisk or question mark.
When an asterisk, for example, just happens to be part of a file name, as might be the case if the file
was called
sneakers.txt
.
.
or with an editor such as
less
, that is when regular expressions can be useful.
sneak*.txt
man bash | col -b > bash.txt
(
vi
vi bash.txt
ab.txt
man page (
bash
man bash
. Then, you can open
). If you want to print the file,
49
and
).

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents