Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道您可以像这样使用批处理附加到文件的末尾...
echo I like turtles >> file.txt
但我想改写文件。怎么可能做到这一点?
刚刚回答了我自己的问题,这有效:
echo I like turtles > file.txt ^ | Just one of these
您可以使用 > 而不是 >> :这将覆盖文件
仅使用一个“>”。例子:
echo "I like turtles" > file.txt
这将覆盖 file.txt 内容。