Complete the code to redirect standard output to a file named output.txt.
echo "Hello World" [1] output.txt
>> appends instead of overwriting.< redirects input, not output.The > operator redirects standard output to a file, overwriting it.
Complete the code to append standard output to a file named log.txt.
ls -l [1] log.txt> overwrites the file instead of appending.2> redirects standard error, not standard output.The >> operator appends output to the file without overwriting.
Fix the error in the code to redirect standard error to errors.log.
grep 'pattern' file.txt [1] errors.log
> redirects standard output, not error.< redirects input, not error output.The 2> operator redirects standard error (file descriptor 2) to a file.
Fill both blanks to redirect standard output to out.txt and standard error to err.txt.
command [1] out.txt [2] err.txt
>> or 2>> when overwriting is needed.> redirects standard output, and 2> redirects standard error.
Fill all three blanks to redirect standard output to output.log, standard error to error.log, and append standard output to combined.log.
my_script.sh [1] output.log [2] error.log [3] combined.log
2>> for standard error when overwriting is needed.> overwrites standard output, 2> overwrites standard error, and >> appends standard output.