185 字
1 分钟
Linux 终端输出语法
语法 | 终端可见性 | 输出文件可见性 | 文件覆写行为 | ||
---|---|---|---|---|---|
stdout | stderr | stdout | stderr | ||
> | ✕ | ✓ | ✓ | ✕ | 覆盖 |
>> | ✕ | ✓ | ✓ | ✕ | 追加 |
2> | ✓ | ✕ | ✕ | ✓ | 覆盖 |
2>> | ✓ | ✕ | ✕ | ✓ | 追加 |
&> | ✕ | ✕ | ✓ | ✓ | 覆盖 |
&>> | ✕ | ✕ | ✓ | ✓ | 追加 |
| tee | ✓ | ✓ | ✓ | ✕ | 覆盖 |
| tee -a | ✓ | ✓ | ✓ | ✕ | 追加 |
n.e. (*) | ✓ | ✓ | ✕ | ✓ | 覆盖 |
n.e. (*) | ✓ | ✓ | ✕ | ✓ | 追加 |
|& tee | ✓ | ✓ | ✓ | ✓ | 覆盖 |
|& tee -a | ✓ | ✓ | ✓ | ✓ | 追加 |
Linux 终端输出语法
https://blog.lpkt.cn/posts/linux-term-output/