How do I save terminal output to a file?
Just add right sided arrow after your command:

someCommand &gt; someFile.txt  


Or if you want to append data(will create file if it doesn't exist):

someCommand &gt;&gt; someFile.txt