LinuxCommandLibrary

cam

Control camera devices from the command line

TLDR

List available cameras

$ cam [[-l|--list]]
copy

List controls of a camera
$ cam [[-c|--camera]] [camera_index] --list-controls
copy

Write frames to a folder
$ cam [[-c|--camera]] [camera_index] [[-C|--capture=]][frames_to_capture] [[-F|--file]]
copy

Display camera feed in a window
$ cam [[-c|--camera]] [camera_index] [[-C|--capture]] [[-S|--sdl]]
copy

SYNOPSIS

cam [generic-options] command [command-options] [device-path]

PARAMETERS

-h
    Display help

-l
    List available devices (FreeBSD syntax)

-s
    Scan bus for devices

command
    Subcommands like scan, reset, tags, inquiry

DESCRIPTION

cam is not a standard command in Linux distributions. It is the primary utility in FreeBSD's CAM (Common Access Method) subsystem, used for controlling SCSI, ATA, ATAPI, and USB storage devices. CAM provides a uniform interface for device management tasks like scanning buses, resetting devices, and querying status.

In Linux, no direct equivalent named cam exists, as Linux uses the Linux SCSI Subsystem (LSS) instead of CAM. Similar tasks are performed with tools from sg3_utils (e.g., sg_scan), lsscsi, udevadm, or smartctl. Users seeking CAM-like functionality in Linux may need custom drivers or emulation layers, but it's uncommon.

CAVEATS

Unavailable in standard Linux; FreeBSD-specific. Linux alternatives required. Potential kernel/driver incompatibilities if ported.

LINUX ALTERNATIVES

Use lsblk for block devices, lsscsi for SCSI bus scan, sg_inq for inquiry data.

PORTABILITY NOTE

Scripts using cam must be adapted for Linux environments.

HISTORY

Developed for FreeBSD's CAM framework in the late 1990s as part of SCSI/ATA unification. Maintained in FreeBSD base system; no native Linux port.

SEE ALSO

lsscsi(8), sg_scan(8), scsi_id(8), udevadm(8), smartctl(8)

Copied to clipboard