Write and append to files
Write to a file using the >
command.
script > run.log
The print
statements of the script will be outputted to run.log
.
Append to a file using the >>
command.
script >> run.log
This is useful if you have loops and want to store the outputs of each loop.