You can chain as many commands together as you like. Say you have an
inexplicable desire to replace every G with Q. For this you use the
command tr G Q, like this:
tac /usr/doc/copyright/GPL | tr G Q | less
You could get the same effect using temporary files and redirection, for
example:
tac /usr/doc/copyright/GPL > tmpfile
tr G Q < tmpfile > tmpfile2
less < tmpfile2
rm tmpfile tmpfile2
Clearly a pipeline is more convenient.
Filename Expansion
Often you want a command to work with a group of files. Wildcards are used
to create a filename expansion pattern: a series of characters and
wildcards that expands to a list of filenames. For example, the pattern
/etc/* expands to a list of all6.2 the files in /etc.
* is a wildcard that can stand for any series of characters, so the
pattern /etc/* will expand to a list of all the filenames beginning with
/etc/.
This filename list is most useful as a set of arguments for a command. For
example, the /etc directory contains a series of subdirectories called
rc0.
Pages:
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133