Greater than
Redirect output to a file. More information: https://gnu.org/software/bash/manual/bash.html#Redirecting-Output.
- Redirect
stdoutto a file:
command > path/to/file
- Append to a file:
command >> path/to/file
- Redirect both
stdoutandstderrto a file:
command &> path/to/file
- Redirect
stderrto/dev/nullto keep the terminal output clean:
command 2> /dev/null
- Clear the file contents or create a new empty file:
> path/to/file