gphoto2
Command-line client for digital cameras via libgphoto2
TLDR
SYNOPSIS
gphoto2 [options] action
DESCRIPTION
gphoto2 is the official command-line frontend for the libgphoto2 library, providing access to more than 2500 digital cameras over USB, serial, PTP/IP, and other transports. It lets photographers and developers capture images, download files, trigger the shutter, tether cameras to computers, and adjust settings without using the vendor software.The tool operates on the current folder of the camera's storage; switch folders with --folder and query structure with --list-folders or --list-files. Each file is addressed by a 1-based index. Multiple actions may be combined on one command line and are executed sequentially.For configuration, gphoto2 exposes the camera's property tree (exposure, ISO, white balance, focus mode, etc.) through --list-config, --get-config, and --set-config. This makes it a common building block for remote capture studios, observatory rigs, and Linux webcam setups (e.g. piping --capture-movie output into ffmpeg and v4l2loopback).
PARAMETERS
--auto-detect
Detect cameras attached to the system.--list-cameras
Print list of all supported camera models.--list-ports
Print list of supported port types.--port PATH
Select a specific port (e.g. usb: or serial:/dev/ttyS0).--camera MODEL
Force a specific camera model.-L, --list-files
List files in the current folder on the camera.-f FOLDER, --folder FOLDER
Switch to specified folder on the camera.-p RANGE, --get-file RANGE
Download files identified by number range (e.g. 1, 1-4, 1,3,5).--get-all-files
Download every file from the current folder.--get-thumbnail RANGE
Download thumbnails rather than full files.--get-raw-data RANGE
Download raw sensor data.-u FILE, --upload-file FILE
Upload a file to the camera.-d RANGE, --delete-file RANGE
Delete files by number.-D, --delete-all-files
Delete every file in the current folder.--capture-image
Trigger the shutter and keep the image on the camera.--capture-image-and-download
Capture and immediately download the resulting file.--capture-movie [=COUNT|=SECONDSs]
Capture a movie or stream of preview frames.-F N, --frames N
Number of frames for time-lapse captures.-I SECONDS, --interval SECONDS
Seconds between frames during time-lapse.--filename TEMPLATE
Specify an output filename template (supports %n, %C, %f, etc.).--stdout
Write downloaded data to standard output instead of a file.--list-config
List all camera configuration entries.--get-config NAME
Print the current value of a configuration entry.--set-config NAME=VALUE
Set a configuration entry (e.g. iso=400, shutterspeed=1/125).--summary
Print a summary of the camera's capabilities.-q, --quiet
Reduce output verbosity.-h, --help
Show usage information.
CAVEATS
Not every camera supports every feature; PTP cameras usually allow capture and config, while older PTP-incompatible cameras expose only file transfer. Stop any desktop service that auto-mounts MTP/PTP cameras (e.g. gvfs-gphoto2-volume-monitor) before using gphoto2 directly; otherwise the USB device is held by another process. Long tethered sessions may require explicit power settings to prevent the camera from sleeping.
HISTORY
The gphoto project was started in 1997 by Scott Fritzinger to give Linux users a common interface for consumer digital cameras. The second-generation library libgphoto2 and its reference client gphoto2 were released in 2001, reworking the architecture around modular camlib drivers. The project is maintained by an open-source community and underpins camera support in desktop environments such as GNOME and KDE.
