redirection
Bash Output redirection
Creates or truncates file and connects descriptor 1 to it. Redirection failure can prevent execution.
Formal Syntax & Structure
bash syntaxbash
command > fileReturn Value
behavior
Creates or truncates file and connects descriptor 1 to it. Redirection failure can prevent execution.
Working Example
Example Snippetbash
printf '%s\n' result > report.txtcat report.txt