linux中经常会用到将内容输出到某文件当中,只需要在执行命令后面加上>或者>>号即可进入操作。
大于符号:将命令执行的结果(标准输出或错误输出,否则将打印到屏幕顶部)重定向到其他输出设备(文件、打开文件操作器、打印机等)。
[En]
Greater than sign: redirects the result of a command execution (standard output or error output, which would otherwise be printed to the top of the screen) to other output devices (file, open file operator, printer, etc.)
小于符号:该命令默认为从键盘输入,更改为从文件或其他打开的文件和设备输入
[En]
Less than sign: the command defaults to input from the keyboard, changed to input from files, or other open files and devices
是追加内容
是覆盖原有内容
示例:
[En]
Example:
要执行该效果,第一个命令在桌面上创建一个test.txt文件,并将ABC写入该文件。
[En]
To execute the effect, the first command creates a test.txt file on the desktop and writes the abc to the file.
第二个命令将再次写入文件的底部。
[En]
The second command will be written again at the bottom of the file.
Original: https://www.cnblogs.com/langtianya/p/7844609.html
Author: jack_ou
Title: linux > 和 >> 、< 区别
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/7069/
转载文章受原作者版权保护。转载请注明原作者出处!