To test the system redirection, we first created two files with the name Leigood Leigood2 and then we gave Leigood input as follows:
Leigood This file is clearly 14 bytes in it.
Then we use cat to see:
Leigood This content is Hello Leigood ...
If we just use a < input redirect, then his effect will just read the contents of the file, and the effect is as follows:
Then we need to use the Redirect method to write the contents of Leigood inside the LEIGOOD2:
This way we can redirect the leigood2 directly into the Leigood.
And even if we modify the content inside the leigood2 leigood nothing changes in the content ...
Input redirection We don't use much, but the output redirects us to use more of the Oh, hehe ...
Output redirection This is more or less used, such as:
ll we usually use this command when the content of the file is displayed, but if we use the > output redirect then his content will be saved to the specified file, the effect is as follows:
If you are using an output redirection when using > a greater than sign, then the next content will be overwritten, but the use of >> two cases, then he will be an additional way to redirect the output ....
Error redirection is actually better understood, such as our command is wrong, we can use error redirection to save the error message, as follows ...
In fact, there are some common examples:
Kill lui lei dog---linux no:14 linux system redirection