Linux redirection command application and Syntax 1. Standard input control Syntax: The command file sends the command execution result to the specified file. For example, www.2cto.com ls-l> list writes the result of executing the "ls-l" command to the file list. Syntax: Command>! The file sends the command execution result to the specified file. If the file already exists, it overwrites it. Example: ls-lg>! List overwrites the result of executing the "ls-lg" command to the file list. Syntax: Command> & file: write any information generated on the screen during command execution to the specified file. For example, cc file1.c> & error writes any information generated when the file1.c file is compiled into the file error. Syntax: Command> file: attaches the command execution result to the specified file. For example, ls-lag> list attaches the result of executing the "ls-lag" command to the file list. Syntax: Command> & file: attaches any information generated on the screen during command execution to the specified file. For example, cc file2.c >>& error attaches any information generated on the screen when the file2.c file is compiled to the file error. 3. command syntax www.2cto.com command> filename redirects the standard output to a new file command> filename redirects the standard output to a file (append) command 1> fielname redirects the standard output to a file command> filename 2> & 1 redirects the standard output and standard error together to a file command 2> filename redirects the standard error command 2> filename in a file redirects the standard output to a file (append) command> filename 2> & 1 redirects the standard output and standard error to a file (append) command filename2 redirects the command to the filename file as the standard input, use the filename2 file as the standard output command & m to redirect the standard output to the file descriptor m. The command comes from