The following is a syntax format for input and output redirection
Two overview Output input redirection
Greater than sign >: Indicates output redirection (overwrites the original file)
Less than <: Input redirect (if you enter something, then it will show what the output is, will not overwrite and append to the original file)
Double greater than sign >>: (indicates output redirection, which appends content to the contents of the original file)
A practical example of a three-output input redirection
1. Output redirection
Description: We can see that using cat to view the contents of the original file is "Reading Anderson", using the output redirection, view the contents of the original file into a "story of small matches." This is sufficient to indicate that the original file can be overwritten with output redirection.
2. Input redirection
Description: We can see that using input redirection, the results show the input content, when using cat to view the original file, its content is a story-telling match. This is enough to indicate that using input redirection does not overwrite and append the contents of the original file.
3. Output Append redirect
Description: We can see that using the Append output redirect, using Cat to view the original content, shows that the "story-telling match is Reading Anderson". This is enough to indicate that using append output redirection increases the content of the original text.
About shell input and output redirection