How do I save terminal output to a file? How do I save the output of a command to a file from terminal?

That is if my command gives some output and it is printed directly on terminal but I want it in some text file or may be other kind of 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