When you run a terminal command, it will typically print output in the terminal, so you can read it immediately. However, you’ll sometimes want to save the output to analyze it later or combine it with another tool.
How to Save Command Line Output to File on Windows, Mac, and Linux
Saving the output of a command to a file is helpful if you're trying to diagnose a problem, and it's super easy to do.