At the end of the command line, add

> file.ext or 1> file.ext to redirect standard output
2> file.ext to redirect standard error

You can use >> to append to an existing file.

For further...