Just pipe it into a file(name) using >
:
someCommand > someFile.txt
Or if you want to append data:
someCommand >> someFile.txt
If you want STDERR too, use this:
someCommand &> someFile.txt
or this, to append:
someCommand &>> someFile.txt