How to save terminal output to a file under Linux/Unix

Originally published at: https://www.cyberciti.biz/faq/how-to-save-terminal-output-to-a-file-under-linux-unix/

How do I save the terminal output to a file when using BASH/KSH/CSH/TCSH under Linux, macOS, *BSD or Unix-like operating systems?