I/O Redirection#
The Bourne Again Shell supports multiple operators to manipulate file descriptors. They can be opened, closed, redirected to other files or duplicated. Most often redirection and duplication of the standard file descriptors is used. This I/O manipulation is the core functionality to combine simple individual tools.
Redirection Operators#
The following table lists the most common redirection operators in their general form:
Operator |
Result |
---|---|
|
Open file for reading on fd |
|
Open file for writing (truncate) on fd |
|
Open file for writing (append) on fd |
|
Make fd |
|
Make fd |
Often they have abbreviated forms when dealing with the standard file descriptors:
Operator |
Result |
---|---|
|
Redirect |
|
Redirect |
|
Redirect |
|
Redirect |
|
Redirect |
|
Make |
|
Make |
\(cmd_1\) |
Redirect \(cmd_1\)’s |
\(cmd_1\) |
Short for \(cmd_1\) |