To redirect the output of a shell script, use the ">" symbol followed by the filename where you want to save the output. For example, ./myscript.sh John > greeting.txt.