Manual page here:
http://software.broadinstitute.org/software/igv/batch
These commands are also available:
http://software.broadinstitute.org/software/igv/PortCommands
Download here:
http://software.broadinstitute.org/software/igv/download
After installing IGV, a script can be run from the terminal. Sample script (save this as IGV_test.bat):
new
snapshotDirectory /path/to/snapshot_dir
load /path/to/sample1.bam
load /path/to/sample2.bam
genome hg19
maxPanelHeight 400
goto chr11:108138003-108138003
snapshot custom_chr11-108138003-108138003.png
goto chr9:21971111-21971111
snapshot custom_chr9-21971111-21971111.png
exit
Example command to run IGV:
bin/IGV_2.3.81/igv.sh -b code/IGV_test.bat
Running the script like this will cause a window to appear, and the commands will be executed.
If you are running IGV from a headless server (accessing the server via ssh), then this will require X11 to be running on the server and installed on your local computer (use XQuartz for OS X). Remember to enable X11 in your terminal by adding -Y to your ssh command, like so:
ssh [email protected] -Y
For scripting purposes, you can run the X11 virtualizer to avoid the requirement for an active X11 window when you call IGV. Use this command:
(Xvfb :10 &) && DISPLAY=:10 java -Xmx750m -jar bin/IGV_2.3.81/igv.jar -b code/IGV_test.bat && killall Xvfb
Example output:

Hi, how did you load multiple bed files? Thanks.