Redirect command
Article Directory
learning target
- The command can be used to redirect the terminal to display the contents of the file redirection
Introduction 1. Redirect command
Redirect also known as output redirection, and save the results of executing the command in the terminal to the destination file.
2. Use the redirect command
command | Explanation |
---|---|
> | If the file will overwrite the previous contents of the file exists, the file operation is equivalent to 'w' mode |
>> | If the file exists appended to the end of the file is written, the file operation corresponding to the 'a' model |
Redirect command renderings:
Description:
As long as the terminal can display the order information can be used to redirect, for example: tree
3. Summary
- Save the contents to a file using the redirection terminal in two ways: > and >>
- > Represent each write only the most recent data, the original data is not retained.
- >> represents the original data is added each time on the basis of the existing data is retained.