Timedora
Free Online Flashcard Deck

Shell Streams and Pipes Free Online Flashcards

Study Shell Streams and Pipes with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is standard input?

Back

Standard input (file descriptor 0) is where a command reads data.

02
Front

What does standard output carry?

Back

Standard output (file descriptor 1) carries a command’s normal results.

03
Front

What does standard error carry?

Back

Standard error (file descriptor 2) carries diagnostics and error messages.

04
Front

What does a regular pipe (`|`) connect?

Back

A regular pipe (`|`) sends one command’s standard output to the next command’s standard input.

05
Front

Does a regular pipe (`|`) pass standard error?

Back

No. A regular pipe passes standard output, not standard error; an earlier command’s errors usually remain visible in the terminal.

06
Front

In Bash, what does `|&` add to a pipe?

Back

In Bash, `|&` sends the earlier command’s standard error through the pipe along with standard output.

07
Front

Which file descriptors identify stdin, stdout, and stderr?

Back

Standard input is file descriptor 0, standard output is 1, and standard error is 2.

08
Front

Why use a pipe between commands?

Back

Pipes let commands pass data directly between stages, so intermediate results need not first be saved to a file.

09
Front

In `printf '%s\n' apple pear apple | sort | uniq -c`, what does `sort` do before `uniq -c`?

Back

`sort` orders the lines before `uniq -c` counts adjacent duplicates.

10
Front

Why can standard output and standard error appear together in the terminal?

Back

In a typical Unix-like shell, both streams are displayed by default, so they may appear together even though they remain separate.

11
Front

In a regular pipe, what becomes the next command’s input?

Back

The first command’s standard output becomes the next command’s standard input.

12
Front

What reaches `uniq -c` in `printf '%s\n' apple pear apple | sort | uniq -c`?

Back

`uniq -c` receives sorted lines and counts adjacent duplicates; the pipe passes the preceding command’s standard output as its input.