redirection
Bash append output
Open for appending; creates a missing file and preserves existing contents. Defaults to stdout.
Formal Syntax & Structure
bash syntaxbash
[n]>>fileParameters & Attributes
| Name | Type | Description |
|---|---|---|
| file | path | Output file in a writable directory. |
Return Value
redirection effect
Open for appending; creates a missing file and preserves existing contents. Defaults to stdout.
Working Example
Example Snippetbash
printf '%s\n' first > notes.txtprintf '%s\n' second >> notes.txtcat notes.txtprintf '%s\n' replacement > notes.txtcat notes.txt