Appendix C. Memory Tables Answer Key

Chapter 2

Table 2-2 Standard Input, Output, and Error Overview

Name

Default Destination

Use in Redirection

File Descriptor Number

STDIN

Computer keyboard

< (same as 0<)

0

STDOUT

Computer monitor

> (same as 1>)

1

STDERR

Computer monitor

2>

2

Table 2-3 Common Bash Redirectors

Redirector

Explanation

> (same as 1>)

Redirects STDOUT. If redirection is to a file, the current contents of that file are overwritten.

>> (same as 1>>)

Redirects STDOUT. If output is written to a file, the output is appended to that file.

2>

Redirects STDERR.

2>&1

Redirects STDERR to the same destination as STDOUT. Notice that this has to be used in combination with normal output redirection, as in ls whuhiu ...

Get Red Hat RHCSA 8 Cert Guide: EX200 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.