2.7.1 Flashcards

1
Q

_____________ is data that is typically streamed from the keyboard. If a bash command accepts input, by default, it is gathered from stdin.

A

Standard input (stdin)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

________________ is data that is typically streamed to the console screen. By default, bash commands send their output to stdout.

A

Standard output (stdout)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

_____________ is data that is also typically streamed to the console screen. If a command needs to output an error messages or give diagnostics, by default, it sends this output to stderr.

A

Standard error (stderr)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A Linux pipe is represented by a

A

vertical bar (|).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The pipe functionality is similar to that of using stdout redirection to write the output of one command to an intermediate file that is then used as input to a _______________ using stdin redirection.

A

second command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A plumbing pipe, where water enters from one end and exits the other, can be used as a mnemonic to help explain how the pipe (|)

A

Operator works.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The output from a command is piped to the

A

tee command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The file used to store the output is added as a tee command __________

A

argument.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A plumbing tee, where water flow is divided from one pipe to two separate pipes, can help you understand how the tee command________

A

works.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

__________ are file-like access point to hardware devices.

A

Device files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

There are two __________that are often used with redirection and piping. /dev/tty and /dev/null.

A

device files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A _________ is a block of text that is redirected as input to a command

A

here document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Here documents are often used in ________ scripts.

A

shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Command substitution is implemented using the ____________ operator.

A

$()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When the shell’s command line interpreter encounters the $() operator:

A

The shell creates a child process that runs the command specified.

The stdout from this first command is redirected back to the shell.

The shell parses the output from the first command into words separated by white space

The shell creates a new command by substituting the parsed output from the first command in place of the $() operator.

The shell creates another child process that runs the second command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly