Previous: Shell Commands, Up: Invocation
You may want to save the output of gdb commands to a file. There are several commands to control gdb's logging.
set logging enabled [on|off]set logging file fileset logging overwrite [on|off]overwrite if
you want set logging enabled on to overwrite the logfile instead.
set logging redirect [on|off]redirect if you want output to go only to the log file.
set logging debugredirect [on|off]debugredirect if you want debug output to go only to the log file.
show loggingYou can also redirect the output of a gdb command to a shell command. See pipe.