GIMP has a few command line options that may be helpful in the use of batch mode.
Valid options are:
-h --help Output this help.
-v --version Output version info.
-b --batch <commands> Run in batch mode.
-g --gimprc <gimprc> Use an alternate gimprc file.
-n --no-interface Run without a user interface.
-r --restore-session Try to restore saved session.
--no-data Do not load patterns, gradients, palettes, brushes.
--verbose Show startup messages.
--no-splash Do not show the startup window.
--no-splash-image Do not add an image to the startup window.
--no-shm Do not use shared memory between GIMP and its plugins.
--no-xshm Do not use the X Shared Memory extension.
--console-messages Display warnings to console instead of a dialog box.
--debug-handlers Enable debugging signal handlers.
--display <display> Use the designated X display.
--system-gimprc <gimprc> Use an alternate system gimprc file.
Of these options, of particular interest to batch mode are the -b, -n, and --no-data flags.
-b or --batch is what actually launches gimp into batch mode. Anything that follows -b on the command line is interpreted as a batch command for gimp to process. The thing to keep in mind is that the shell will process this command first, so it may be Necessary to properly escape any special characters to the shell.
-n or --no-interface tells gimp not to launch the gui that it normally launches for interactive use. For command line usage, there no real point in having a gui present, and it also speeds up the start of gimp somewhat. NOTE: This does not imply that the -n flag means gimp can be used without an Xserver in this mode. GIMP still needs a Xserver to render fonts. More on this later.
--no-data tells GIMP not to load the data packs that gimp normally loads as part of the start-up procedure and greatly reduces the startup time. This includes brushes, patterns, palettes, and gradients so tools that need that data shouldn't use this option.