The stream redirection operators within Bash are used to redirect the input and output of commands to files, devices, or other commands. The valid stream redirection operators within Bash are:
< : This operator redirects the standard input (STDIN) of a command from a file or device. For example, wc -l < file.txt counts the number of lines in file.txt by using it as the input for the wc command.
> : This operator redirects the standard output (STDOUT) of a command to a file or device, overwriting any existing content. For example, echo "Hello World" > file.txt writes the string “Hello World” to file.txt, replacing any previous content.
>> : This operator redirects the standard output (STDOUT) of a command to a file or device, appending to any existing content. For example, echo "Hello World" >> file.txt writes the string “Hello World” to file.txt, without deleting any previous content.
>& : This operator redirects one file descriptor to another file descriptor. A file descriptor is a number that represents an open file or device. The standard input (STDIN) has the file descriptor 0, the standard output (STDOUT) has the file descriptor 1, and the standard error (STDERR) has the file descriptor 2. For example, command > file 2>&1 redirects both the standard output and standard error of the command to the file.
<& : This operator redirects one file descriptor from another file descriptor. For example, command <&3 redirects the standard input of the command from the file descriptor 3.
The other operators are not valid stream redirection operators within Bash. They will cause syntax errors or unexpected behavior. For example, #> is a comment followed by a redirection operator, %> is a modulo operator followed by a redirection operator, and >>> is a bitwise right shift operator followed by a redirection operator.
References:
Redirections (Bash Reference Manual)
Guide to Stream Redirections in Linux | Baeldung on Linux
Standard Streams in Bash | Delft Stack
Bash Tutorial => Redirection
stream redirection order and what os perform in details