OS Manuals

/usr/bin/sg_opcodes

SCSI utilities for Linux, Unix and Windows

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

Usage:  sg_opcodes [--alpha] [--compact] [--enumerate] [--help] [--hex]
                   [--inhex=FN] [--json[=JO]] [--js-file=JFN] [--mask]
                   [--mlu] [--no-inquiry] [--opcode=OP[,SA]] [--pdt=DT]
                   [--raw] [--rctd] [--repd] [--rep-opts=RO] [--sa=SA]
                   [--tmf] [--unsorted] [--verbose] [--version]
                   DEVICE
  where:
    --alpha|-a      output list of operation codes sorted alphabetically
    --compact|-c    more compact output
    --enumerate|-e    use '--opcode=' and '--pdt=' to look up name,
                      ignore DEVICE
    --help|-h       print usage message then exit
    --hex|-H        output response in hex, use -HHH for hex
                    suitable for later use of --inhex= option
    --inhex=FN|-i FN    contents of file FN treated as hex and used
                        instead of DEVICE which is ignored
    --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
    --mask|-m       show cdb usage data (a mask) when all listed
    --mlu|-M        show MLU bit when all listed
    --no-inquiry|-n    don't output INQUIRY information
    --opcode=OP[,SA]|-o OP[,SA]    opcode (OP) and service action (SA)
    --pdt=DT|-p DT    give peripheral device type for '--no-inquiry',
                      '--enumerate' and '--inhex=FN'
    --raw|-r        output response in binary to stdout unless --inhex=FN
                    is given then FN is parsed as binary instead
    --rctd|-R       set RCTD (return command timeout descriptor) bit
    --repd|-q       set Report Extended Parameter Data bit, with --tmf
    --rep-opts=RO|-Q RO    set Reporting Options field in cdb
    --sa=SA|-s SA    service action in addition to opcode
    --tmf|-t        output list of supported task management functions
    --unsorted|-u    output list of operation codes as is
                     (def: sort by opcode (then service action))
    --verbose|-v    increase verbosity
    --old|-O        use old interface (use as first option)
    --version|-V    print version string then exit

Performs a SCSI REPORT SUPPORTED OPERATION CODES or a REPORT SUPPORTED
TASK MANAGEMENT FUNCTIONS command. All values are in decimal by default,
prefix with '0x' or add a trailing 'h' for hex numbers.
Options (26)
OptionDescriptionSource
--inhex, -i FN|-icontents of file FN treated as hex and used instead of DEVICE which is ignoredhelp + 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
--opcode OPopcode (OP) and service action (SA)help
--pdt, -p DT|-pgive peripheral device type for '--no-inquiry', '--enumerate' and '--inhex=FN'help + man
--rep-opts, -Q RO|-QRO is the reporting options field value that is placed in RSOC command (cdb).help + man
--sa, -s SA|-sthe DEVICE will be queried for a command with the given service action (i.e. the SA value).help + man
-a, --alphawhen all supported commands are being listed there is no requirement for the device server (i.e. the DEVICE) to sort the list of commands. (in the manual page but not in --help)man
-c, --compactsome command names, especially those associated with some service actions, are getting longer. (in the manual page but not in --help)man
-e, --enumeratethis option prints the name of the SCSI command based on the given opcode, peripheral device type and optionally the service action. (in the manual page but not in --help)man
-h, --helpoutputs the usage message summarizing command line options then exits. (in the manual page but not in --help)man
-H, --hexoutputs the response in ASCII hexadecimal to stdout. (in the manual page but not in --help)man
-m, --maskadditionally prints out the cdb mask in hex. (in the manual page but not in --help)man
-M, --mluadditionally prints out an indication (0 or 1) whether the command effects all logical units in the containing target. (in the manual page but not in --help)man
-n, --no-inquiryPrior to calling a SCSI RSOC or a RSTMF command, a SCSI INQUIRY command is performed. (in the manual page but not in --help)man
-O, --oldSwitch to older style options. (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
-R, --rctdset report command timeout descriptor (RCTD) bit in the cdb. (in the manual page but not in --help)man
-q, --repdset read extended parameter data (REPD) bit in the report task management functions cdb. (in the manual page but not in --help)man
-t, --tmflist supported task management functions. (in the manual page but not in --help)man
-u, --unsortedwhen all supported commands are being listed there is no requirement for the device server (i.e. the DEVICE) to sort the list of commands. (in the manual page but not in --help)man
-v, --verboseincrease level of verbosity. (in the manual page but not in --help)man
-V, --versionprint out version string then exit. (in the manual page but not in --help)man
-N, --newSwitch to the newer style options. (in the manual page but not in --help)man
-o OPthe DEVICE will be queried for the given operation code (i.e. OP) which is the first byte of a SCSI command. (in the manual page but not in --help)man
-?output usage message. (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.