>
Redirect output. More information: https://gnu.org/software/bash/manual/bash.html#Redirecting-Output.
- Redirect
stdoutto a file:
>
- Append to a file:
>>
- Redirect both
stdoutandstderrto a file:
&>
- Redirect
stderrto/dev/nullto keep the terminal output clean:
2>/dev/null
- Clear the file contents or create a new empty file:
>
- Redirect
stderrtostdoutfor piping them together:
2>&1 |
- Open a persistent file descriptor:
exec >
- Write to a custom file descriptor:
>&
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
