Get the App
SLTechnology News&Howtos  ›  Servers  › 

Detailed explanation of Linux instruction file overwriting and file appending

Shulou Source: shulou.com Published: 2022-06-02 01:03:11 11月14日 Update

1. Difference between instruction > and > >

Directive >: if the file exists, overwrite the contents of the original file; if the original file does not exist, create the file, and then add information.

Directive > >: the contents of the original file will not be overwritten and will be appended to the end of the file.

two。 Basic grammar (understand the difference between > and > >)

Basic syntax function description ls-l > filename list contents written to file ls-l > filename list contents appended to the end of file cat file 1 > file 2 overwrite the contents of file 1 to file 2 echo "contents" > filename write the contents to the file

3. Example:

Ls-l > filename:

Ls-l > > filename:

Other commands are similar. Without repeating it, you can verify it by yourself.

The above is the Linux instruction file coverage and file additional detailed interpretation and integration introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

Tags: File content instruction syntax information function command instance tail end question website help support integration verification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Docker Redmi Shulou Information MySQL