Difference:
In Linux, > means overwriting the original file content (the date of the file will also be automatically updated), >> means appending the content (it will start a new file) line, the date of the file will also be updated automatically).
(Recommended tutorial: linux tutorial)
Example:
1. Save the results of the history command execution to the history.log file
1 2 |
|
2. Execute the command curl 'xxx' and save the return result in log.log
1 |
|
3. Execute the command cat /etc/hosts and save the return result in hosts.log中
1 2 3 4 |
|
Note: When using > , when executing a command, a new file following > will be generated each time, replacing the previously generated file (the file creation time will also change accordingly).
The above is the detailed content of What is the difference between '<' and '<<' in linux. For more information, please follow other related articles on the PHP Chinese website!