Linux - output redirection command

① Terminal command line "print output" command: echo "content to be printed out"

②For creating a file and entering content in the file, it is also called redirection ( coverage level, re-entering the content in the file will overwrite the previous content ), the command is as follows:

Command: echo "content to input" > target file name.txt (file type)      (> is a redirection symbol)

If you want to add content based on the previous content without overwriting, you need to enter the following command:

Command: echo "content to input" >> target file name.txt (file type)

③ The command to view the content of the query file: cat  target file name.txt (file type)   

④ To merge the contents of multiple files into another file, enter the following command:

Command: cat filename1.filetype filename2.filetype ...    filen.filetype   target filename.filetype ( overwrite      )

Command: cat filename1.filetype filename2.filetype ...    filen.filetype >>  target filename.filetype        ( append)

Guess you like

Origin blog.csdn.net/butnotif/article/details/128688355