Output Redirection Flashcards

(10 cards)

1
Q

Output Redirection

A

Details of how to manage command output in Linux using redirection operators

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

Standard Output (stdout)

A

■ Default output stream for command results

■ Displays output on the terminal screen
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Basic Output Redirection (>)

A

■ Redirects standard output to a file

■ Overwrites existing file content
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Example of >

A

echo Hello, world! > greetings.txt

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

Append Output Redirection (»)

A

■ Appends output to the end of an existing file

■ Preserves previously recorded content

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

Example of »_space;

A

echo “Apache service restarted successfully”»_space; /var/log/service.log

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

Standard Error (stderr)

A

■ Separate stream for error messages

■ Allows redirection of error messages independently from regular output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Example of stderr

A

systemctl restart apache 2> /var/log/apache_error.log

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

A

Append error output

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

&>

A

Redirect both stdout and stderr

Captures all output and error messages into one log file

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