Chapter 5 Exams Flashcards

1
Q

Which answer displays output to a terminal and ignores all errors?

A
&>file

B
2> &>file

C
2>/dev/null

D
1>/dev/null

A

C

2>/dev/null

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

Which answer sends output to a file and sends errors to a different file?

A
>file 2>file2

B
>file 1>file2

C
>file &2>file2

D
| tee file

A

A

>file 2>file2

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

Which answer sends both output and errors to a file, creating it or overwriting its contents?

A
| tee file

B
2 &>file

C
1 &>file

D
&>file

A

D

&>file

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

Which answer sends output and errors to the same file ensuring existing file content is preserved?

A
>file 2>file2

B
&>file

C
»file 2>&1

D
»file 1>&1

A

C

|&raquo_space;file 2>&1

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

Which answer discards all messages normally sent to the terminal?

A
>file 2>file2

B
&>/dev/null

C
&>/dev/null 2>file

D
&>file

A

B

&>/dev/null

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