mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-05 04:55:23 +02:00
21 lines
458 B
Markdown
21 lines
458 B
Markdown
![]() |
# Greater than
|
||
|
|
||
|
> Redirect output to a file.
|
||
|
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Output>.
|
||
|
|
||
|
- Redirect `stdout` to a file:
|
||
|
|
||
|
`{{command}} > {{path/to/file}}`
|
||
|
|
||
|
- Append to a file:
|
||
|
|
||
|
`{{command}} >> {{path/to/file}}`
|
||
|
|
||
|
- Redirect both `stdout` and `stderr` to a file:
|
||
|
|
||
|
`{{command}} &> {{path/to/file}}`
|
||
|
|
||
|
- Redirect both `stdout` and `stderr` to `/dev/null` to keep the terminal output clean:
|
||
|
|
||
|
`{{command}} &> /dev/null`
|