Redirect output to a file. More information: https://gnu.org/software/bash/manual/bash.html#Redirecting-Output.
stdout to a file:command > path/to/file
command >> path/to/file
stdout and stderr to a file:command &> path/to/file
stdout and stderr to /dev/null to keep the terminal output clean:command &> /dev/null
> path/to/file