Which of the following are valid stream redirection operators within Bash? (Choose two.)
Which of the following are valid stream redirection operators within Bash? (Choose two.)
In Bash, stream redirection operators are used to redirect input and output of commands. The '<' operator is used for input redirection, which allows a file to be used as the input for a command. For example, 'command < file'. The '2>&1' operator is used to redirect the standard error (file descriptor 2) to the same location as the standard output (file descriptor 1), which is useful for capturing both output streams. The other options '#>' and '%>' are not recognized as standard stream redirection operators in Bash, while '>>>' is also not a valid operator as '>>' is used for appending output to a file.
The answer is correct: https://tldp.org/LDP/abs/html/io-redirection.html
2>&1 is used to redirect standard error output (2) to standard output (1), for example: find / -name *.log > result.txt 2>&1: register errors in results.txt and don't display nothing find / -name *.log > result.txt: display errors
Is it supposed to be < or > Am used to redirecting my output via >. I have not encountered < before. Someone please educate me.
You use < when you want to input some information to a command. Basically, it's the other way around of >.
Answer: AE