Linux study notes 7 - echo and redirection

1. echo text content

echo will display the specified text in the terminal, usually combined with redirection .

You can also create text files



2. Redirect > and >>

Linux allows redirection of command execution results to a file

Output/append what should be displayed on the terminal to the specified file

in

> means output, which will overwrite the original content of the file

>> means append, which appends the content to the end of the existing file.


When the output of the command is too much, you can use redirection to store the system output in a file, such as;

tree >> test.txt output the tree diagram in the test.txt file

more test.txt is read in split screen





Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326693153&siteId=291194637