OS Manuals

/usr/bin/sg_stream_ctl

SCSI utilities for Linux, Unix and Windows

From sg3-utils 1.49-r3 (enterprise-packages), captured 2026-11-08 by running sg_stream_ctl --help (exit 0). permalink

Usage: sg_stream_ctl  [-brief] [--close] [--ctl=CTL] [-get] [--help]
                      [--hex] [--id=SID] [--inhex=FN] [--json[=JO]]
                      [--js-file=JFN] [--maxlen=LEN] [--open] [--raw]
                      [--readonly] [--verbose] [--version] DEVICE
  where:
    --brief|-b          for open, output assigned stream id to stdout, or
                        -1 if error; for close, output 0, or -1; for get
                        output list of stream id, 1 per line
    --close|-c          close stream given by --id=SID
    --ctl=CTL|-C CTL    CTL is stream control value, (STR_CTL field)
                        1 -> open; 2 -> close
    --get|-g            do GET STREAM STATUS command (default if no other)
    --help|-h           print out usage message
    --hex|-H            print 'get' output in hex
    --id=SID|-i SID     for close, SID is stream_id to close; for get,
                        list from and including this stream id
    --inhex=FN|-I FN    input taken from file FN rather than DEVICE,
                        assume it is ASCII hex or, if --raw, in binary
    --json[=JO]|-j[=JO]     output in JSON instead of plain text
                            use --json=? for JSON help
    --js-file=JFN|-J JFN    JFN is a filename to which JSON output is
                            written (def: stdout); truncates then writes
    --maxlen=LEN|-m LEN    length in bytes of buffer to receive data-in
                           (def: 8 (for open and close); 252 (for get,
                           but increase if needed)
    --open|-o           open a new stream, return assigned stream id
    --raw|-R            --hex output or --inhex= input: in binary
                        instead of hex
    --readonly|-r       open DEVICE read-only (if supported)
    --verbose|-v        increase verbosity
    --version|-V        print version string and exit

Performs a SCSI GET STREAM STATUS or STREAM CONTROL command. If --open,
--close or --ctl=CTL given (only one) then performs STREAM CONTROL
command. If --get or no other selecting option given then performs a
GET STREAM STATUS command. A successful --open will output the assigned
stream id to stdout (and ignore --id=SID , if given).
Options (16)
OptionDescriptionSource
--ctl, -C CTL|-CCTL is the value placed in the STR_CTL field of the STREAM CONTROL command (cdb).help + man
--id, -i SID|-iSID is a stream id, a value between 1 and 65535.help + man
--inhex, -I FN|-Iinput taken from file FN rather than DEVICE, assume it is ASCII hex or, if --raw, in binaryhelp + man
--json JO]|-j[=JOoutput in JSON instead of plain text use --json=? for JSON helphelp
--js-file, -J JFN|-JJFN is a filename to which JSON output is written (def: stdout);help + man
--maxlen, -m LEN|-mlength in bytes of buffer to receive data-in (def: 8 (for open and close);help + man
-b, --briefthis option reduces the output of the GET STREAM STATUS command to just one number (in decimal) per line sent to stdout. (in the manual page but not in --help)man
-c, --closeselects the STREAM CONTROL command and sets STR_CTL<--0x2 (i.e. 'close'). (in the manual page but not in --help)man
-g, --getselects the GET STREAM STATUS command. (in the manual page but not in --help)man
-h, --helpoutput the usage message then exit. (in the manual page but not in --help)man
-H, --hex (in the manual page but not in --help)man
-o, --openselects the STREAM CONTROL command and sets STR_CTL<--0x1 (i.e. 'open'). (in the manual page but not in --help)man
-r, --readonlythis option sets a 'read-only' flag when the underlying operating system opens the given DEVICE. (in the manual page but not in --help)man
-R, --rawoutput response in binary (to stdout) unless the --inhex=FN option is also given. (in the manual page but not in --help)man
-v, --verboseincrease the level of verbosity, (i.e. debug output). (in the manual page but not in --help)man
-V, --versionprint the version string and then exit. (in the manual page but not in --help)man
Exit status (1) from the manual page
0it is successful

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.