📜  如何在 IO 重定向中附加文件 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:30.890000             🧑  作者: Mango

代码示例1
cmd >>file.txt 2>&1

>>file.txt: Open file.txt in append mode and redirect stdout there.
2>&1: Redirect stderr to "where stdout is currently going". In this case, that is a file opened in append mode. In other words, the &1 reuses the file descriptor which stdout currently uses.