Output redirection and input redirection in linux

Redirection under Linux can be classified as being used to generate correct logs or error logs on the Linux server at regular intervals, which is convenient for operation and maintenance personnel to view and troubleshoot.

 

Correct output and error output are saved at the same time. We commonly use the following methods:

 

        There cannot be spaces before and after the greater than sign after the error output 2

        Command >> File 2> $1    --- Save both correct output and error output to the same file by appending.

        Command &>>File            --- The execution of the above command is exactly the same, and the correct output and error output are saved to the same file by appending.

        command >> file 1 2 >> file 2      --- append the correct to file 1 and the wrong to file 2



 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326402046&siteId=291194637