GPHOTO2(1)
πΈ GPHOTO2(1) πΈ β straight outta The gPhoto2 Reference (the man)
okay bestie, buckle up, because this is the manual page for gphoto2, and it's a whole personality. it's long, it's got range, it's giving "reference document that ate." we're doing this together, one section at a time, and nothing gets skipped. not one flag. not one default value. periodt. π
β¨ NAME β¨
gphoto2 β the command-line gphoto2 client. that's it, that's the name, short and iconic.
π¦ SYNOPSIS π¦
like, here's the whole shape of it. yes it's a lot. no we're not scared.
gphoto2 [--debug] [--debug-logfile FILENAME] [--debug-loglevel LEVEL]
[[-q] | [--quiet]] [[-v] | [--verbose]] [[-h] | [--help]]
[--usage]
[--hook-script FILENAME]
[--list-cameras] [--list-ports] [--stdout] [--stdout-size]
[--parsable]
[--auto-detect] [--port PATH] [--speed SPEED] [--camera MODEL]
[--filename FILENAME] [--filenumber FILENUMBER]
[--usbid USBIDS]
[[-a] | [--abilities]]
[[--folder FOLDER] | [-f FOLDER]] [[[-R] | [--recurse]] |
[--no-recurse]]
[[-l] | [--list-folders]]
[[-L] | [--list-files]] [[-m NAME] | [--mkdir NAME]]
[[-r NAME] | [--rmdir NAME]] [[-n] | [--num-files]]
[[-p RANGE or NAME] | [--get-file RANGE or NAME]] [[-P] |
[--get-all-files]]
[[-t RANGE or NAME] | [--get-thumbnail RANGE or NAME]]
[[-T] | [--get-all-thumbnails]]
[--get-raw-data RANGE or NAME] [--get-all-raw-data]
[--get-audio-data RANGE or NAME] [--get-all-audio-data]
[--get-exif RANGE or NAME] [--get-all-exif]
[--get-metadata RANGE or NAME] [--get-all-metadata]
[--upload-metadata FILENAME]
[--force-overwrite]
[--new]
[[-d RANGE or NAME] | [--delete-file RANGE or NAME]] [[-D] |
[--delete-all-files]]
[[-u FILENAME] | [--upload-file FILENAME]] [--config]
[--list-config] [--list-all-config]
[--get-config CONFIGENTRY]
[--set-config CONFIGENTRY=CONFIGVALUE]
[--set-config-index CONFIGENTRY=CONFIGINDEX]
[--set-config-value CONFIGENTRY=CONFIGVALUE] [--reset]
[--capture-preview] [--show-preview]
[[-F COUNT] | [--frames COUNT]] [[-I SECONDS] |
[--interval SECONDS]]
[--reset-interval]
[--capture-image] [--trigger-capture]
[--capture-movie SECONDS or COUNT] [--capture-sound]
[--capture-tethered SECONDS, COUNT or STRING]
[--wait-event SECONDS, COUNT or STRING]
[--wait-event-and-download SECONDS, COUNT or STRING]
[--keep] [--no-keep]
[--reverse]
[--show-info RANGE or NAME]
[--show-exif RANGE or NAME]
[--storage-info]
[--summary]
[--manual]
[--about]
[--shell]
π DESCRIPTION π
so the lore is: libgphoto2(3) is a cross-platform digital camera library, and gphoto2(1) is a command-line client for it. like the library is the main character and gphoto2 is her very capable bestie who handles the talking. π
real talk though, here's the one thing you gotta internalize before we go anywhere:
when an option takes a RANGE of files, thumbnails, or other data, they are numbered beginning at 1. a range is a comma-separated list of numbers or spans (first-last). and ranges are XOR (exclusive or), so that 1-5,3,7 is equivalent to 1,2,4,5,7. yeah. it's XOR. it ate and left no crumbs. write it down. π«Ά
π the options, in order, all of them, no cap π
--debugβ turn on debugging output. debug output goes tostderrby default, or to whatever filename you handed to the--debug-logfileoption.--debug-logfile FILENAME(since 2.3.0) β the logfile to write the debugging info to, if--debugis given.--debug-loglevel LEVEL(since 2.5.5) β how chatty the debug logging gets. possible values, with incrementing verbosity, are:error,debug,data,all. the default isall.--hook-script FILENAME(new after 2.3.0) β run the hook scriptFILENAMEevery single time a certain event happens withingphoto2. the hook script reads the environment variableACTION, and it must ignoreACTIONvalues it doesn't know about. like, mind your business, script.ACTION=initβgphoto2has just been initialized. if the hook script returns with a non-zero exit code right now,gphoto2will abort. so likeβ¦ be chill.ACTION=startβgphoto2has just finished parsing the command line and is about to start executing the commands given on the command line.ACTION=downloadβgphoto2has just downloaded a file to the computer, storing it in the file indicated by the environment variableARGUMENT.ACTION=stopβgphoto2is about to finish. do your final cleanups here, bestie.
all other environment variables are passed to the hook script unchanged β and yes you can absolutely use that to pass data to the hook script. sneaky but valid.
the hook script may be specified in the ~/.gphoto/settings file as gphoto2=hook-script=filename.
-q,--quietβ quiet output (default=verbose). shhh. π€«-v,--versionβ display version and exit. that's the tea, bye.-h,--helpβ display options and short description.--usageβ display a short usage message. the tl;dr of the tl;dr.--list-camerasβ list supported camera models.--list-portsβ list supported port devices.--stdoutβ send file to stdout.--stdout-sizeβ print filesize before data.--parsableβ outputs the filelist in a line based format that could be passed into a shellscript or other filter. very pipeline-friendly of her.--auto-detectβ list auto-detected cameras and the ports to which they are connected.--port PATHβ specify port device.--list-portsprints a list of valid, usable ports. in case of multiple USB cameras,--auto-detectshows you the specific port each camera is connected to. π¦--speed SPEEDβ specify serial transfer speed.--camera MODELβ specify camera model. the--list-camerasoption prints a list of all explicitly supported cameras.
most model names contain spaces: remember to enclose the name in quotes so that the shell knows it is one parameter. for example:
--camera "Kodak DC240"
β οΈ note that if you specify--camera, you must also specify--port. otherwise the--cameraoption will be silently ignored. silently!! like it's not gonna warn you, it's just gonna ghost your whole setting. π
--filename FILENAMEβ when downloading files from the camera, specify the file name or file name pattern to use when storing the downloaded file on the local disk. when uploading a file to the camera, specify the filename to store the uploaded file as on the camera.
the --filename option accepts %a, %A, %b, %B, %d, %H, %k, %I, %l, %j, %m, %M, %S, %y, %%, (see date(1)) and, in addition, %n for the number, %C for the filename suffix, %f for the filename without suffix, %F for the foldername, %: for the complete filename in lowercase.
π note that%:is still in alpha stage, and the actual character or syntax may still be changed. e.g. it might be possible to use%#fand%#Cfor lower case versions, and%^fand%^Cfor upper case versions. it's giving "work in progress, don't come for her."
%n is the only conversion specifier to accept a padding character and width: %03n will pad with zeros to width 3 (e.g. print the number 7 as 007). leaving out the padding character (e.g. %3n) will use an implementation specific default padding character which may or may not be suitable for use in file names. so like, specify your padding. don't leave it on read. π
the default value for this option can be specified in the ~/.gphoto/settings file as gphoto2=filename=value.
--filenumber FILENUMBERβ if you specify the filename using the--filenameoption and use the%npattern, this pattern usually starts at1. for incremental usage, you can use--filenumberto have it start at another numberFILENUMBER. glow-up for your numbering.--usbid USBIDSβ (expert only) override USB IDs.USBIDSmust be of the form
DetectedVendorID:DetectedProductID=TreatAsVendorID:TreatAsProductID
to treat any USB device detected as DetectedVendorID:DetectedProductID as TreatAsVendorID:TreatAsProductID instead. all the VendorIDs and ProductIDs should be hexadecimal numbers beginning in C notation, i.e. beginning with '0x'.
example:
--usbid 0x4a9:0x306b=0x4a9:0x306c
π₯ "expert only" is not a vibe check, it's a warning label. proceed like the main character you are, but proceed knowing.
-a,--abilitiesβ display the camera and driver abilities specified in thelibgphoto2driver. this all does not query the camera, it uses data provided by the library. use--summaryto query an overview of the camera. so like, this one's reading from the library's notes, not asking the camera directly. iykyk.-f,--folder FOLDERβ specify camera folder (default="/").-R,--recurseβ recursion (default for download).--no-recurseβ no recursion (default for deletion).-l,--list-foldersβ list folders in folder. folders in folders in folders. it's folders all the way down.-L,--list-filesβ list files in folder.-m,--mkdir NAMEβ create a directory.-r,--rmdir NAMEβ remove a directory.-n,--num-filesβ display number of files.-p,--get-file RANGEβ get files given in range.-P,--get-all-filesβ get all files from folder.-t,--get-thumbnail RANGEβ get thumbnails given in range.-T,--get-all-thumbnailsβ get all thumbnails from folder.--get-raw-data RANGEβ get raw data given in range.--get-all-raw-dataβ get all raw data from folder.--get-audio-data RANGEβ get audio data given in range.--get-all-audio-dataβ get all audio data from folder.--get-exif RANGEβ get Exif given in range.--get-all-exifβ get all Exif from folder.--upload-metadata FILENAMEβ upload meta data for the specific file, taken from a file prefix withmeta_. π--get-metadata RANGEβ get meta data given in range.--get-all-metadataβ get all meta data from folder.--force-overwriteβ overwrite files without asking. no thoughts, just overwrite.--skip-existingβ skip files if they exist already on the local directory.--newβ only get not already downloaded files. this option depends on camera support of flagging already downloaded images and is not available for all drivers. so like, vibes vary by hardware, bestie.-d,--delete-file RANGEβ delete files given in range.-D,--delete-all-filesβ delete all files in folder (defaults to--no-recurse).-u,--upload-file FILENAMEβ upload a file to camera.--capture-previewβ capture a quick preview.-B--bulb SECONDSβ do a bulb capture for the specified amount of seconds.--show-previewβ capture a quick preview and displays it in the terminal using Ascii Art (ifaalibwas used during build). yes, Ascii Art. in the terminal. it's giving 1998 and honestly? iconic. β¨-F COUNT,--frames COUNTβ number of frames to capture in one run. default is infinite number of frames. literally infinite. go off.-I SECONDS,--interval SECONDSβ time between capture of multiple frames.
(since 2.4) if SIGUSR1 signal is received, a picture is taken immediately without waiting for the end of the current interval period (see the section called "SIGNALS"). a value of -1 will let gphoto2 wait forever, i.e. until a signal arrives. see also --reset-interval.
--reset-intervalβ setting this option will reset the time interval to the value given by the-I|--intervaloption when aSIGUSR1signal is received in time-lapse mode.--capture-imageβ snaps a pic and keeps it on the camera π no download, the file just vibes on the card.--capture-image-and-downloadβ snaps a pic and immediately pulls it down to the computer, bestie. instantly. π«Ά--trigger-captureβ triggers the capture and bounces right back out πββοΈβ¨ want the image actually downloaded too? that's a--wait-event-and-downloadsituation.
heads up: this feature is only available for some camera brands and drivers π
--reverseβ when you're doing file operations like--get-all-files,-Por-T, this flips the order of the files being downloaded π iconic little reorder.--keepβ when doing--capture-image-and-downloador interval capture, this keeps the images on the camera's memory card πΎ like, don't delete them, they live there.--no-keepβ when doing--capture-image-and-downloador interval capture, this does not keep the images on the memory card after downloading them during capture. (this is the default β¨)--keep-rawβ when doing--capture-image-and-downloador interval capture, this keeps the RAW images on the camera's memory card but still downloads the JPEGs π lowkey perfect when you're doing dual mode capture and wanna review the JPEGs already during capture.--capture-movie SECONDSβ captures a movie π¬ if the camera supports previews, it'll capture a stream of previews (motion-jpeg) as fast as the camera can go.
if no argument is specified, it captures preview frames until you press Ctrl+C. the arguments you can pass are either seconds of capture or a number of preview frames.
--capture-soundβ captures an audio clip ποΈ fr fr no driver supports this at this time π--capture-tethered SECONDS, MILLISECONDS, COUNT or MATCHSTRINGβ letsgphoto2wait for notifications from the camera that an object was added π this is the moment for tethered capture β you press the shutter on the camera and the image immediately transfers to the machine for processing. so slay.
pair it with --hook-script to immediately postprocess or display the images, and you've got a whole studio workflow going π
this option requires support in the driver and by the camera. currently newer Canon EOS and Nikon DLSR work.
--wait-event SECONDS, MILLISECONDS, COUNT or MATCHSTRING,--wait-event-and-download SECONDS, MILLISECONDS, COUNT or MATCHSTRINGβ letsgphoto2wait for notifications from the camera for various events π great for seeing what the camera does and waiting for objects to be added. the objects are kept on camera in the--wait-eventversion β with--wait-event-and-downloadthey get downloaded. π¦
--wait-event-and-download is equivalent to --capture-tethered.
the time to wait can be any of these, bestie:
- full seconds with an
ssuffix - a number of milliseconds with an
mssuffix - a number of events (just a number)
- a sub-string to match
if nothing happens, a timeout is generated after 1 second, so a --wait-event=5 will take at most 5 seconds. a --wait-event=5s will take exactly 5 seconds β±οΈ
it's also possible to wait for MATCHSTRING β for things like CAPTURECOMPLETE, FILEADDED, TIMEOUT or other events printed out π«
if no argument is given, the wait time is 1 million events (basically forever π).
in the download variant this can be used together with --hook-script to immediately postprocess or display the images β that can help a studio workflow π
this option requires support in the driver and by the camera.
if gphoto2 receives a SIGUSR1 during the wait, it'll immediately take a picture (similar to --capture-image) πΈ and depending on mode either leave it on camera or download it. (Since 2.5.28)
if gphoto2 receives a SIGUSR2 during the wait, it'll safely end the tethering. (Since 2.5.25)
--show-info RANGEβ shows information for a single or multiple images π like width, height, size and/or the capture time. the receipts, basically.--configβ starts a ncurses based text configuration menu π₯οΈ note:gphoto2needs to be built against CDK for this feature.--list-configβ lists all configuration entries π every single one.--list-all-configβ lists all configuration entries and their values and choices π this is a combo of--list-configplus calling--get-configon all the entries.--get-config CONFIGENTRYβ gets the specified configuration entry π this lists the type, the current value, and also the available options of this configuration value.--set-config CONFIGENTRY=CONFIGVALUEβ sets the specified configuration entry π for lists of choices of values, this setting first looks upCONFIGVALUEas a value and then as an index into the choice list. since that's not fully clear, you can use--set-config-indexor--set-config-valueto be more clear about what's being searched for.
look at the output of --get-config to see what values are possible to set here π
--set-config-index CONFIGENTRY=CONFIGINDEXβ sets the specified configuration entry by specifying the index into the list of choices for the configuration value π’ obviously this only works for configuration settings that offer a list of choices.
peep the output of --get-config to see what indices are possible to set here.
--set-config-value CONFIGENTRY=CONFIGVALUEβ sets the specified configuration entry by specifying its new value β¨ for lists of choices the value is looked up and set.
again, look at the output of --get-config to see what values are possible to set here π«Ά
--resetβ resets the specified (or autodetected) USB port π this resets the USB port of either the first auto-detected camera, or the port specified with--port usb:XXX,YYY. useful if somehow the protocol talking to the camera locked up β it simulates plugging out and in the camera π--storage-infoβ displays information about the camera's storage media πΎ the tea on your card.--summaryβ summary of camera status π--manualβ camera driver manual π--aboutβ about the camera driver πββοΈ--shellβ starts thegphoto2shell, an interactive environment πΈ see SHELL MODE for a detailed description.
π SHELL MODE π
okay so inside the shell, these are the commands you can use π
cd DIRECTORYβ changes to the specified directory on the camera πlsβ lists the contents of the current directory on the camera πlcd DIRECTORYβ changes to the specified directory on the local machine πget FILENAMEβ downloads the specified file to the current directory β¬οΈput FILENAMEβ uploads the specified file from the current system directory to the camera's current directory β¬οΈget-thumbnail FILENAMEβ downloads the specified thumbnail to the current directory πΌοΈget-raw FILENAMEβ downloads the specified raw data to the current directory π§get-exif FILENAMEβ downloads the specified Exif data to the current directory πΈshow-info FILENAMEβ shows information of the specified file πdelete FILENAMEβ deletes the specified file or directory ποΈmkdir DIRECTORYβ creates a directory namedDIRECTORYβ¨rmdir DIRECTORYβ removes a directory namedDIRECTORYπshow-exif FILENAMEβ shows EXIF information (only if compiled with EXIF support) πcapture-imageβ captures a single image and keeps it on the camera π·capture-image-and-downloadβ captures a single image and downloads it from the camera β¬οΈπ·capture-previewβ captures a preview image and downloads it from the camera ποΈlist-configβ lists all configuration values πget-config NAMEβ gets the configuration specified byNAMEπ§set-config NAME=VALUEβ sets the configuration specified byNAMEtoVALUEπset-config-value NAME=VALUEβ sets the configuration specified byNAMEtoVALUEπset-config-index NAME=VALUEβ sets the configuration specified byNAMEto theINDEXinto the list of choices. works only for Menu or Radio button entries πwait-event COUNT or SECONDSβ waits for events from the camera for the specified time in SECONDS (if suffixed withs) or the COUNT of events from the camera, where every second a timeout event happens β³ newly added images are kept on the camera.
default is 1 event π¦
wait-event-and-download COUNT or SECONDS,capture-tethered COUNT or SECONDSβ waits for events from the camera for the specified time in SECONDS (if suffixed withs) or the COUNT of events from the camera, where every second a timeout event happens β³ newly added images are downloaded from the camera.
default is 1 event π«Ά
help,?β displays command usage πexit,quit,qβ exits thegphoto2shell π
π ENVIRONMENT VARIABLES π
CAMLIBSβ if set, defines the directory where thelibgphoto2library looks for its camera drivers (camlibs) π― you only need to set this with non-standard installations.IOLIBSβ if set, defines the directory where thelibgphoto2_portlibrary looks for its I/O drivers (iolibs) π you only need to set this with non-standard installations.LD_DEBUGβ set this toallto receive lots of debug information regarding library loading on ld based systems π§ (yes, lots.)USB_DEBUGβ if set, defines the numeric debug level with which thelibusblibrary will print messages π¬ in order to get some debug output, set it to1.
β‘ SIGNALS β‘
SIGUSR1(since 2.4) β in time-lapse capture and in tethering or wait-event mode, receiving aSIGUSR1signal makesgphoto2take a picture immediately πΈ
if the --reset-interval option is given, the time counter is reset to the value given by the -I|--interval option. note that the camera will need some time (from 50ms to a few seconds) to actually capture the image β±οΈ
SIGUSR2(since 2.5.26) β in tethering or wait-event mode, receiving aSIGUSR2signal ends the tethering or wait-event mode π super useful if you don't know the end beforehand but still want to safely exit the waiting. iconic exit strategy, honestly.
π SEE ALSO π
libgphoto2(3)- The gPhoto2 Manual[1]
- The gphoto.org website[2]
- Digital Camera Support for UNIX, Linux and BSD[3]
πΈ EXAMPLES πΈ
okay bestie, these are the actual real-life things you're gonna type, and honestly? each one is a little slay π
gphoto2 --list-portsβ shows you what kinds of ports you actually have β like USB and serial. that's it, that's the whole vibe. a little port inventory moment β¨gphoto2 --auto-detectβ shows what camera(s) you've got connected. the "who's in the group chat rn" of commands π«Άgphoto2 --list-filesβ lists the files on your camera. your camera's camera roll, exposed.gphoto2 --get-file 7-13β grabs files number 7 through 13, using the list thatgphoto2 --list-filesgave you. so like, run--list-filesfirst, find your faves, then pull that range. iykyk πgphoto2 --capture-image --interval 60 --hook-script /usr/share/doc/gphoto2/test-hook.shβ captures one (1) image every 60 seconds from now to eternity. no cap, eternity. and the example hook script gets called after each captured image has been stored on the computer, so it's lowkey doing the most for you π
gphoto2 --capture-image --interval 60 --hook-script /usr/share/doc/gphoto2/test-hook.sh
and if something's acting weird and you need to figure out why? to track down errors, you can add the --debug parameter to the gphoto2 command line β and if you're dealing with USB problems, set the environment variable USB_DEBUG=1. that's the detective arc, bestie π
yeah the eternity one is real and it is not a drill β that command does not stop on its own. main character energy, but make it infinite π
π AUTHORS π
giving credit where credit is due, because these people built the thing we're all out here using π
- Tim Waugh β Author.
- Hans Ulrich Niedermann, current maintainer
<gp@n-dimensional.de>β Author. - Michael J. Rensing β Author.
- Marcus Meissner
<marcus@jet.franken.de>β Author. - Miscellanous Contributors. β (yes, that's the spelling, i'm not touching it π«Ά)
- The gPhoto2 Team β Author.
- Tim Waugh
<twaugh@redhat.com>β Original man page author. - Hans Ulrich Niedermann
<gp@n-dimensional.de>β Current man page editor.
π¦ NOTES π¦
the receipts, the sources, the "go read this if you wanna know more" corner β¨
- The gPhoto2 Manual http://www.gphoto.org/doc/manual/
- The gphoto.org website http://www.gphoto.org/
- Digital Camera Support for UNIX, Linux and BSD http://www.teaser.fr/~hfiguiere/linux/digicam.html
and that's the whole page, bestie! π this little masterpiece comes from the source [FIXME: source] (yes, literally that, it's iconic in a cursed way π), with a pubdate of 2015-08-01, dated all the way back to August 2006, and it's GPHOTO2(1) β go forth and photograph things, you absolute legend πππ
π¦ where this page comes from
- alpine 3.24: gphoto2-doc 2.5.32-r0 Β· LGPL-2.1-or-later
- arch rolling: gphoto2 2.5.32-1 Β· GPL AND LGPL
- nixos 26.05: gphoto2 2.5.32
- nixpkgs unstable: gphoto2 2.5.32
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms