neulab/tldr huggingface dataset:
exec will not work well with TUI applications when a console is not present, as is done when launching applications under wish. It is desirable to have console applications hidden and detached. This is a designed-in limitation as exec wants to communicate over pipes.  The Expect extension addresses this issue when communicating with a TUI application.
When attempting to execute an application, exec first searches for the name as it was specified.  Then, in order, .com, .exe, .bat and .cmd are appended to the end of the specified name and it searches for the longer name.  If a directory name was not specified as part of the application name, the following directories are automatically searched in order when attempting to locate the application:
•  The directory from which the Tcl executable was loaded.
•  The current directory.
•  The Windows NT 32-bit system directory.
•  The Windows NT 16-bit system directory.
•  The Windows NT home directory.
•  The directories listed in the path.
In order to execute shell built-in commands like dir and copy, the caller must prepend the desired command with “cmd.exe /c ” because built-in commands are not implemented using executables.
Unix (including Mac OS X) The exec command is fully functional and works as described.
Here are some examples of the use of the exec command on Unix.  To execute a simple program and get its result:
exec uname -a
WORKING WITH NON-ZERO RESULTS To execute a program that can return a non-zero result, you should wrap the call to exec in catch and check the contents of the -errorcode return option if you have an error:
set status 0 if {[catch {exec grep foo bar.txt} results options]} { set details [dict get $options -errorcode] if {[lindex $details 0] eq "CHILDSTATUS"} { set status [lindex $details 2] } else { # Some other error; regenerate it to let caller handle return -options $options -level 0 $results } }
This is more easily written using the try command, as that makes it       │ simpler to trap specific types of errors. This is done using code like    │ this:                                                                     │
try {                                                              │ set results [exec grep foo bar.txt]                            │ set status 0                                                   │ } trap CHILDSTATUS {results options} {                             │ set status [lindex [dict get $options -errorcode] 2]           │ }                                                                  │
WORKING WITH QUOTED ARGUMENTS When translating a command from a Unix shell invocation, care should be taken over the fact that single quote characters have no special significance to Tcl.  Thus:
awk '{sum += $1} END {print sum}' numbers.list
would be translated into something like:
exec awk {{sum += $1} END {print sum}} numbers.list
WORKING WITH GLOBBING If you are converting invocations involving shell globbing, you should remember that Tcl does not handle globbing or expand things into multiple arguments by default.  Instead you should write things like this:
exec ls -l {*}[glob *.tcl]
WORKING WITH USER-SUPPLIED SHELL SCRIPT FRAGMENTS One useful technique can be to expose to users of a script the ability to specify a fragment of shell script to execute that will have some data passed in on standard input that was produced by the Tcl program.  This is a common technique for using the lpr program for printing. By far the simplest way of doing this is to pass the user's script to the user's shell for processing, as this avoids a lot of complexity with parsing other languages.
set lprScript [get from user...] set postscriptData [generate somehow...]
exec $env(SHELL) -c $lprScript << $postscriptData
Here are some examples of the use of the exec command on Windows.  To start an instance of notepad editing a file without waiting for the user to finish editing the file:
exec notepad myfile.txt &
To print a text file using notepad:
exec notepad /p myfile.txt
WORKING WITH CONSOLE PROGRAMS If a program calls other programs, such as is common with compilers, then you may need to resort to batch files to hide the console windows that sometimes pop up:
exec cmp.bat somefile.c -o somefile
With the file cmp.bat looking something like:
@gcc %* or like another variant using single parameters: @gcc %1 %2 %3 %4 %5 %6 %7 %8 %9
WORKING WITH COMMAND BUILT-INS Sometimes you need to be careful, as different programs may have the same name and be in the path. It can then happen that typing a command at the DOS prompt finds a different program than the same command run via exec. This is because of the (documented) differences in behaviour between exec and DOS batch files.
When in doubt, use the command auto_execok: it will return the complete path to the program as seen by the exec command.  This applies especially when you want to run “internal” commands like dir from a Tcl script (if you just want to list filenames, use the glob command.)  To do that, use this:
exec {*}[auto_execok dir] *.tcl
WORKING WITH NATIVE FILENAMES Many programs on Windows require filename arguments to be passed in with backslashes as pathname separators. This is done with the help of the file nativename command. For example, to make a directory (on NTFS) encrypted so that only the current user can access it requires use of the CIPHER command, like this:
set secureDir "~/Desktop/Secure Directory" file mkdir $secureDir exec CIPHER /e /s:[file nativename $secureDir]
error(3tcl), file(3tcl), open(3tcl)
execute, pipeline, redirection, subprocess
CARGO-RUSTC(1)               General Commands Manual              CARGO-RUSTC(1)
cargo-rustc - Compile the current package, and pass extra options to the compiler
cargo rustc [options] [-- args]
The specified target for the current package (or package specified by -p if provided) will be compiled along with all of its dependencies. The specified args will all be passed to the final compiler invocation, not any of the dependencies. Note that the compiler will still unconditionally receive arguments such as -L, --extern, and --crate-type, and the specified args will simply be added to the compiler invocation.
See <https://doc.rust-lang.org/rustc/index.html> for documentation on rustc flags.
This command requires that only one target is being compiled when additional arguments are provided. If more than one target is available for the current package the filters of --lib, --bin, etc, must be used to select which target is compiled.
To pass flags to all compiler processes spawned by Cargo, use the RUSTFLAGS environment variable <https://doc.rust-lang.org/cargo/reference/environment-variables.html> or the build.rustflags config value <https://doc.rust-lang.org/cargo/reference/config.html>.
Package Selection By default, the package in the current working directory is selected. The -p flag can be used to choose a different package in a workspace.
-p spec, --package spec The package to build. See cargo-pkgid(1) for the SPEC format.
Target Selection When no target selection options are given, cargo rustc will build all binary and library targets of the selected package.
Passing target selection flags will build only the specified targets.
--lib Build the package's library.
--bin name... Build the specified binary. This flag may be specified multiple times and supports common Unix glob patterns.
--bins Build all binary targets.
--example name... Build the specified example. This flag may be specified multiple times and supports common Unix glob patterns.
--examples Build all example targets.
--test name... Build the specified integration test. This flag may be specified multiple times and supports common Unix glob patterns.
--tests Build all targets in test mode that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the manifest settings for the target.
--bench name... Build the specified benchmark. This flag may be specified multiple times and supports common Unix glob patterns.
--benches Build all targets in benchmark mode that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the manifest settings for the target.
--all-targets Build all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
Compilation Options --target triple Build for the given architecture. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a list of supported targets.
--release Build optimized artifacts with the release profile. See also the --profile option for choosing a specific profile by name.
--profile name Build with the given profile.
The rustc subcommand will treat the following named profiles with special behaviors:
•  check — Builds in the same way as the cargo-check(1) command with the dev profile.
•  test — Builds in the same way as the cargo-test(1) command, enabling building in test mode which will enable tests and enable the test cfg option. See rustc tests <https://doc.rust-lang.org/rustc/tests/index.html> for more detail.
•  bench — Builds in the same was as the cargo-bench(1) command, similar to the test profile.
See the the reference <https://doc.rust-lang.org/cargo/reference/profiles.html> for more details on profiles.
--ignore-rust-version Build the target even if the selected Rust compiler is older than the required Rust version as configured in the project's rust-version field.
Miscellaneous Options -j N, --jobs N Number of parallel jobs to run. May also be specified with the build.jobs config value <https://doc.rust-lang.org/cargo/reference/config.html>. Defaults to the number of CPUs.
1. Check if your package (not including dependencies) uses unsafe code:
cargo rustc --lib -- -D unsafe-code
2. Try an experimental flag on the nightly compiler, such as this which prints the size of every type:
cargo rustc --lib -- -Z print-type-sizes
cargo(1), cargo-build(1), rustc(1)
EXIFTOOL(1)            User Contributed Perl Documentation           EXIFTOOL(1)
exiftool - Read and write meta information in files
Reading exiftool [OPTIONS] [-TAG...] [--TAG...] FILE...
Writing exiftool [OPTIONS] -TAG[+-<]=[VALUE]... FILE...
Copying exiftool [OPTIONS] -tagsFromFile SRCFILE [-SRCTAG[>DSTTAG]...] FILE...
Other exiftool [ -ver | -list[w|f|r|wf|g[NUM]|d|x] ]
For specific examples, see the EXAMPLES sections below.
This documentation is displayed if exiftool is run without an input FILE when one is expected.
A command-line interface to Image::ExifTool, used for reading and writing meta information in a variety of file types.  FILE is one or more source file names, directory names, or "-" for the standard input.  Metadata is read from source files and printed in readable form to the console (or written to output text files with -w).
To write or delete metadata, tag values are assigned using -TAG=[VALUE], and/or the -geotag, -csv= or -json= options.  To copy or move metadata, the -tagsFromFile feature is used.  By default the original files are preserved with "_original" appended to their names -- be sure to verify that the new files are OK before erasing the originals.  Once in write mode, exiftool will ignore any read-specific options.
Note:  If FILE is a directory name then only supported file types in the directory are processed (in write mode only writable types are processed).  However, files may be specified by name, or the -ext option may be used to force processing of files with any extension.  Hidden files in the directory are also processed.  Adding the -r option causes subdirectories to be processed recursively, but subdirectories with names beginning with "." are skipped unless -r. is used.
Below is a list of file types and meta information formats currently supported by ExifTool (r = read, w = write, c = create):
File Types ------------+-------------+-------------+-------------+------------ 360   r/w   | DR4   r/w/c | JNG   r/w   | ODP   r     | RIFF  r 3FR   r     | DSS   r     | JP2   r/w   | ODS   r     | RSRC  r 3G2   r/w   | DV    r     | JPEG  r/w   | ODT   r     | RTF   r 3GP   r/w   | DVB   r/w   | JSON  r     | OFR   r     | RW2   r/w A     r     | DVR-MS r    | JXL   r     | OGG   r     | RWL   r/w AA    r     | DYLIB r     | K25   r     | OGV   r     | RWZ   r AAE   r     | EIP   r     | KDC   r     | ONP   r     | RM    r AAX   r/w   | EPS   r/w   | KEY   r     | OPUS  r     | SEQ   r ACR   r     | EPUB  r     | LA    r     | ORF   r/w   | SKETCH r AFM   r     | ERF   r/w   | LFP   r     | ORI   r/w   | SO    r AI    r/w   | EXE   r     | LIF   r     | OTF   r     | SR2   r/w AIFF  r     | EXIF  r/w/c | LNK   r     | PAC   r     | SRF   r APE   r     | EXR   r     | LRV   r/w   | PAGES r     | SRW   r/w ARQ   r/w   | EXV   r/w/c | M2TS  r     | PBM   r/w   | SVG   r ARW   r/w   | F4A/V r/w   | M4A/V r/w   | PCD   r     | SWF   r ASF   r     | FFF   r/w   | MACOS r     | PCX   r     | THM   r/w AVI   r     | FITS  r     | MAX   r     | PDB   r     | TIFF  r/w AVIF  r/w   | FLA   r     | MEF   r/w   | PDF   r/w   | TORRENT r AZW   r     | FLAC  r     | MIE   r/w/  | PEF   r/w   | TTC   r BMP   r     | FLIF  r/w   | MIFF  r   c | PFA   r     | TTF   r BPG   r     | FLV   r     | MKA   r     | PFB   r     | TXT   r BTF   r     | FPF   r     | MKS   r     | PFM   r     | VCF   r CHM   r     | FPX   r     | MKV   r     | PGF   r     | VRD   r/w/c COS   r     | GIF   r/w   | MNG   r/w   | PGM   r/w   | VSD   r CR2   r/w   | GPR   r/w   | MOBI  r     | PLIST r     | WAV   r CR3   r/w   | GZ    r     | MODD  r     | PICT  r     | WDP   r/w CRM   r/w   | HDP   r/w   | MOI   r     | PMP   r     | WEBP  r CRW   r/w   | HDR   r     | MOS   r/w   | PNG   r/w   | WEBM  r CS1   r/w   | HEIC  r/w   | MOV   r/w   | PPM   r/w   | WMA   r CSV   r     | HEIF  r/w   | MP3   r     | PPT   r     | WMV   r CZI   r     | HTML  r     | MP4   r/w   | PPTX  r     | WTV   r DCM   r     | ICC   r/w/c | MPC   r     | PS    r/w   | WV    r DCP   r/w   | ICS   r     | MPG   r     | PSB   r/w   | X3F   r/w DCR   r     | IDML  r     | MPO   r/w   | PSD   r/w   | XCF   r DFONT r     | IIQ   r/w   | MQV   r/w   | PSP   r     | XLS   r DIVX  r     | IND   r/w   | MRC   r     | QTIF  r/w   | XLSX  r DJVU  r     | INSP  r/w   | MRW   r/w   | R3D   r     | XMP   r/w/c DLL   r     | INSV  r     | MXF   r     | RA    r     | ZIP   r DNG   r/w   | INX   r     | NEF   r/w   | RAF   r/w   | DOC   r     | ISO   r     | NRW   r/w   | RAM   r     | DOCX  r     | ITC   r     | NUMBERS r   | RAR   r     | DPX   r     | J2C   r     | O     r     | RAW   r/w   |
Meta Information ----------------------+----------------------+--------------------- EXIF           r/w/c  |  CIFF           r/w  |  Ricoh RMETA    r GPS            r/w/c  |  AFCP           r/w  |  Picture Info   r IPTC           r/w/c  |  Kodak Meta     r/w  |  Adobe APP14    r XMP            r/w/c  |  FotoStation    r/w  |  MPF            r MakerNotes     r/w/c  |  PhotoMechanic  r/w  |  Stim           r Photoshop IRB  r/w/c  |  JPEG 2000      r    |  DPX            r ICC Profile    r/w/c  |  DICOM          r    |  APE            r MIE            r/w/c  |  Flash          r    |  Vorbis         r JFIF           r/w/c  |  FlashPix       r    |  SPIFF          r Ducky APP12    r/w/c  |  QuickTime      r    |  DjVu           r PDF            r/w/c  |  Matroska       r    |  M2TS           r PNG            r/w/c  |  MXF            r    |  PE/COFF        r Canon VRD      r/w/c  |  PrintIM        r    |  AVCHD          r Nikon Capture  r/w/c  |  FLAC           r    |  ZIP            r GeoTIFF        r/w/c  |  ID3            r    |  (and more)
Case is not significant for any command-line option (including tag and group names), except for single-character options when the corresponding upper-case option exists.  Many single-character options have equivalent long-name versions (shown in brackets), and some options have inverses which are invoked with a leading double-dash.  Unrecognized options are interpreted as tag names (for this reason, multiple single-character options may NOT be combined into one argument).  Contrary to standard practice, options may appear after source file names on the exiftool command line.
Option Overview Tag operations
-TAG or --TAG                    Extract or exclude specified tag -TAG[+-^]=[VALUE]                Write new value for tag -TAG[+-]<=DATFILE                Write tag value from contents of file -TAG[+-]<SRCTAG                  Copy tag value (see -tagsFromFile)
-tagsFromFile SRCFILE            Copy tag values from file -x TAG      (-exclude)           Exclude specified tag
Input-output text formatting
-args       (-argFormat)         Format metadata as exiftool arguments -b          (-binary)            Output metadata in binary format -c FMT      (-coordFormat)       Set format for GPS coordinates -charset [[TYPE=]CHARSET]        Specify encoding for special characters -csv[[+]=CSVFILE]                Export/import tags in CSV format -csvDelim STR                    Set delimiter for CSV file -d FMT      (-dateFormat)        Set format for date/time values -D          (-decimal)           Show tag ID numbers in decimal -E,-ex,-ec  (-escape(HTML|XML|C))Escape tag values for HTML, XML or C -f          (-forcePrint)        Force printing of all specified tags -g[NUM...]  (-groupHeadings)     Organize output by tag group -G[NUM...]  (-groupNames)        Print group name for each tag -h          (-htmlFormat)        Use HTML formatting for output -H          (-hex)               Show tag ID numbers in hexadecimal -htmlDump[OFFSET]                Generate HTML-format binary dump -j[[+]=JSONFILE] (-json)         Export/import tags in JSON format -l          (-long)              Use long 2-line output format -L          (-latin)             Use Windows Latin1 encoding -lang [LANG]                     Set current language -listItem INDEX                  Extract specific item from a list -n          (--printConv)        No print conversion -p FMTFILE  (-printFormat)       Print output in specified format -php                             Export tags as a PHP Array -s[NUM]     (-short)             Short output format -S          (-veryShort)         Very short output format -sep STR    (-separator)         Set separator string for list items -sort                            Sort output alphabetically -struct                          Enable output of structured information -t          (-tab)               Output in tab-delimited list format -T          (-table)             Output in tabular format -v[NUM]     (-verbose)           Print verbose messages -w[+|!] EXT (-textOut)           Write (or overwrite!) output text files -W[+|!] FMT (-tagOut)            Write output text file for each tag -Wext EXT   (-tagOutExt)         Write only specified file types with -W -X          (-xmlFormat)         Use RDF/XML output format
Processing control
-a          (-duplicates)        Allow duplicate tags to be extracted -e          (--composite)        Do not generate composite tags -ee[NUM]    (-extractEmbedded)   Extract information from embedded files -ext[+] EXT (-extension)         Process files with specified extension -F[OFFSET]  (-fixBase)           Fix the base for maker notes offsets -fast[NUM]                       Increase speed when extracting metadata -fileOrder[NUM] [-]TAG           Set file processing order -i DIR      (-ignore)            Ignore specified directory name -if[NUM] EXPR                    Conditionally process files -m          (-ignoreMinorErrors) Ignore minor errors and warnings -o OUTFILE  (-out)               Set output file or directory name -overwrite_original              Overwrite original by renaming tmp file -overwrite_original_in_place     Overwrite original by copying tmp file -P          (-preserve)          Preserve file modification date/time -password PASSWD                 Password for processing protected files -progress[:[TITLE]]              Show file progress count -q          (-quiet)             Quiet processing -r[.]       (-recurse)           Recursively process subdirectories -scanForXMP                      Brute force XMP scan -u          (-unknown)           Extract unknown tags -U          (-unknown2)          Extract unknown binary tags too -wm MODE    (-writeMode)         Set mode for writing/creating tags -z          (-zip)               Read/write compressed information
-@ ARGFILE                       Read command-line arguments from file -k          (-pause)             Pause before terminating -list[w|f|wf|g[NUM]|d|x]         List various exiftool capabilities -ver                             Print exiftool version number --                               End of options
-geotag TRKFILE                  Geotag images from specified GPS log -globalTimeShift SHIFT           Shift all formatted date/time values -use MODULE                      Add features from plug-in module
-delete_original[!]              Delete "_original" backups -restore_original                Restore from "_original" backups
-api OPT[[^]=[VAL]]              Set ExifTool API option -common_args                     Define common arguments -config CFGFILE                  Specify configuration file name -echo[NUM] TEXT                  Echo text to stdout or stderr -efile[NUM][!] ERRFILE           Save names of files with errors -execute[NUM]                    Execute multiple commands on one line -list_dir                        List directories, not their contents -srcfile FMT                     Process a different source file -stay_open FLAG                  Keep reading -@ argfile even after EOF -userParam PARAM[[^]=[VAL]]      Set user parameter (API UserParam opt)
Option Details Tag operations
-TAG Extract information for the specified tag (eg. "-CreateDate"). Multiple tags may be specified in a single command.  A tag name is the handle by which a piece of information is referenced.  See Image::ExifTool::TagNames for documentation on available tag names. A tag name may include leading group names separated by colons (eg. "-EXIF:CreateDate", or "-Doc1:XMP:Creator"), and each group name may be prefixed by a digit to specify family number (eg. "-1IPTC:City").  Use the -listg option to list available group names by family.
A special tag name of "All" may be used to indicate all meta information (ie. -All).  This is particularly useful when a group name is specified to extract all information in a group (but beware that unless the -a option is also used, some tags in the group may be suppressed by same-named tags in other groups).  The wildcard characters "?" and "*" may be used in a tag name to match any single character and zero or more characters respectively. These may not be used in a group name, with the exception that a group name of "*" (or "All") may be used to extract all instances of a tag (as if -a was used).  Note that arguments containing wildcards must be quoted on the command line of most systems to prevent shell globbing.
A "#" may be appended to the tag name to disable the print conversion on a per-tag basis (see the -n option).  This may also be used when writing or copying tags.
If no tags are specified, all available information is extracted (as if "-All" had been specified).
Note:  Descriptions, not tag names, are shown by default when extracting information.  Use the -s option to see the tag names instead.
--TAG Exclude specified tag from extracted information.  Same as the -x option.  Group names and wildcards are permitted as described above for -TAG.  Once excluded from the output, a tag may not be re- included by a subsequent option.  May also be used following a -tagsFromFile option to exclude tags from being copied (when redirecting to another tag, it is the source tag that should be excluded), or to exclude groups from being deleted when deleting all information (eg. "-all= --exif:all" deletes all but EXIF information).  But note that this will not exclude individual tags from a group delete (unless a family 2 group is specified, see note 4 below).  Instead, individual tags may be recovered using the -tagsFromFile option (eg. "-all= -tagsfromfile @ -artist").
-TAG[+-^]=[VALUE] Write a new value for the specified tag (eg. "-comment=wow"), or delete the tag if no VALUE is given (eg. "-comment=").  "+=" and "-=" are used to add or remove existing entries from a list, or to shift date/time values (see Image::ExifTool::Shift.pl and note 6 below for more details).  "+=" may also be used to increment numerical values (or decrement if VALUE is negative), and "-=" may be used to conditionally delete or replace a tag (see "WRITING EXAMPLES" for examples).  "^=" is used to write an empty string instead of deleting the tag when no VALUE is given, but otherwise it is equivalent to "=".
TAG may contain one or more leading family 0, 1, 2 or 7 group names, prefixed by optional family numbers, and separated colons.  If no group name is specified, the tag is created in the preferred group, and updated in any other location where a same-named tag already exists.  The preferred group is the first group in the following list where TAG is valid: 1) EXIF, 2) IPTC, 3) XMP.
The wildcards "*" and "?" may be used in tag names to assign the same value to multiple tags.  When specified with wildcards, "unsafe" tags are not written.  A tag name of "All" is equivalent to "*" (except that it doesn't require quoting, while arguments with wildcards do on systems with shell globbing), and is often used when deleting all metadata (ie. "-All=") or an entire group (eg. "-XMP-dc:All=", see note 4 below).  Note that not all groups are deletable, and that the JPEG APP14 "Adobe" group is not removed by default with "-All=" because it may affect the appearance of the image.  However, color space information is removed, so the colors may be affected (but this may be avoided by copying back the tags defined by the ColorSpaceTags shortcut).  Use the -listd option for a complete list of deletable groups, and see note 5 below regarding the "APP" groups.  Also, within an image some groups may be contained within others, and these groups are removed if the containing group is deleted:
JPEG Image: - Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD, GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD. - Deleting ExifIFD also deletes InteropIFD and MakerNotes. - Deleting Photoshop also deletes IPTC.
TIFF Image: - Deleting EXIF only removes ExifIFD which also deletes InteropIFD and MakerNotes.
1) Many tag values may be assigned in a single command.  If two assignments affect the same tag, the latter takes precedence (except for list-type tags, for which both values are written).
2) In general, MakerNotes tags are considered "Permanent", and may be edited but not created or deleted individually.  This avoids many potential problems, including the inevitable compatibility problems with OEM software which may be very inflexible about the information it expects to find in the maker notes.
3) Changes to PDF files by ExifTool are reversible (by deleting the update with "-PDF-update:all=") because the original information is never actually deleted from the file.  So ExifTool alone may not be used to securely edit metadata in PDF files.
4) Specifying "-GROUP:all=" deletes the entire group as a block only if a single family 0 or 1 group is specified.  Otherwise all deletable tags in the specified group(s) are removed individually, and in this case is it possible to exclude individual tags from a mass delete.  For example, "-time:all --Exif:Time:All" removes all deletable Time tags except those in the EXIF.  This difference also applies if family 2 is specified when deleting all groups.  For example, "-2all:all=" deletes tags individually, while "-all:all=" deletes entire blocks.
5) The "APP" group names ("APP0" through "APP15") are used to delete JPEG application segments which are not associated with another deletable group.  For example, specifying "-APP14:All=" will NOT delete the APP14 "Adobe" segment because this is accomplished with "-Adobe:All".
6) When shifting a value, the shift is applied to the original value of the tag, overriding any other values previously assigned to the tag on the same command line.  To shift a date/time value and copy it to another tag in the same operation, use the -globalTimeShift option.
Special feature:  Integer values may be specified in hexadecimal with a leading "0x", and simple rational values may be specified as fractions.
-TAG<=DATFILE or -TAG<=FMT Set the value of a tag from the contents of file DATFILE.  The file name may also be given by a FMT string where %d, %f and %e represent the directory, file name and extension of the original FILE (see the -w option for more details).  Note that quotes are required around this argument to prevent shell redirection since it contains a "<" symbol.  If DATFILE/FMT is not provided, the effect is the same as "-TAG=", and the tag is simply deleted.  "+<=" or "-<=" may also be used to add or delete specific list entries, or to shift date/time values.
-tagsFromFile SRCFILE or FMT Copy tag values from SRCFILE to FILE.  Tag names on the command line after this option specify the tags to be copied, or excluded from the copy.  Wildcards are permitted in these tag names.  If no tags are specified, then all possible tags (see note 1 below) from the source file are copied to same-named tags in the preferred location of the output file (the same as specifying "-all").  More than one -tagsFromFile option may be used to copy tags from multiple files.
By default, this option will update any existing and writable same- named tags in the output FILE, but will create new tags only in their preferred groups.  This allows some information to be automatically transferred to the appropriate group when copying between images of different formats. However, if a group name is specified for a tag then the information is written only to this group (unless redirected to another group, see below).  If "All" is used as a group name, then the specified tag(s) are written to the same family 1 group they had in the source file (ie. the same specific location, like ExifIFD or XMP-dc).  For example, the common operation of copying all writable tags to the same specific locations in the output FILE is achieved by adding "-all:all".  A different family may be specified by adding a leading family number to the group name (eg. "-0all:all" preserves the same general location, like EXIF or XMP).
SRCFILE may be the same as FILE to move information around within a single file.  In this case, "@" may be used to represent the source file (ie. "-tagsFromFile @"), permitting this feature to be used for batch processing multiple files.  Specified tags are then copied from each file in turn as it is rewritten.  For advanced batch use, the source file name may also be specified using a FMT string in which %d, %f and %e represent the directory, file name and extension of FILE.  (eg. the current FILE would be represented by "%d%f.%e", with the same effect as "@").  See the -w option for FMT string examples.
A powerful redirection feature allows a destination tag to be specified for each copied tag.  With this feature, information may be written to a tag with a different name or group.  This is done using "'-DSTTAG<SRCTAG'" or "'-SRCTAG>DSTTAG'" on the command line after -tagsFromFile, and causes the value of SRCTAG to be copied from SRCFILE and written to DSTTAG in FILE.  Has no effect unless SRCTAG exists in SRCFILE.  Note that this argument must be quoted to prevent shell redirection, and there is no "=" sign as when assigning new values.  Source and/or destination tags may be prefixed by a group name and/or suffixed by "#".  Wildcards are allowed in both the source and destination tag names.  A destination group and/or tag name of "All" or "*" writes to the same family 1 group and/or tag name as the source.  If no destination group is specified, the information is written to the preferred group. Whitespace around the ">" or "<" is ignored. As a convenience, "-tagsFromFile @" is assumed for any redirected tags which are specified without a prior -tagsFromFile option.  Copied tags may also be added or deleted from a list with arguments of the form "'-SRCTAG+<DSTTAG'" or "'-SRCTAG-<DSTTAG'" (but see Note 5 below).
An extension of the redirection feature allows strings involving tag names to be used on the right hand side of the "<" symbol with the syntax "'-DSTTAG<STR'", where tag names in STR are prefixed with a "$" symbol.  See the -p option and the "Advanced formatting feature" section for more details about this syntax.  Strings starting with a "=" sign must insert a single space after the "<" to avoid confusion with the "<=" operator which sets the tag value from the contents of a file.  A single space at the start of the string is removed if it exists, but all other whitespace in the string is preserved.  See note 8 below about using the redirection feature with list-type stags, shortcuts or when using wildcards in tag names.
See "COPYING EXAMPLES" for examples using -tagsFromFile.
1) Some tags (generally tags which may affect the appearance of the image) are considered "unsafe" to write, and are only copied if specified explicitly (ie. no wildcards).  See the tag name documentation for more details about "unsafe" tags.
2) Be aware of the difference between excluding a tag from being copied (--TAG), and deleting a tag (-TAG=).  Excluding a tag prevents it from being copied to the destination image, but deleting will remove a pre-existing tag from the image.
3) The maker note information is copied as a block, so it isn't affected like other information by subsequent tag assignments on the command line, and individual makernote tags may not be excluded from a block copy.  Also, since the PreviewImage referenced from the maker notes may be rather large, it is not copied, and must be transferred separately if desired.
4) The order of operations is to copy all specified tags at the point of the -tagsFromFile option in the command line.  Any tag assignment to the right of the -tagsFromFile option is made after all tags are copied.  For example, new tag values are set in the order One, Two, Three then Four with this command:
exiftool -One=1 -tagsFromFile s.jpg -Two -Four=4 -Three d.jpg
This is significant in the case where an overlap exists between the copied and assigned tags because later operations may override earlier ones.
5) The normal behaviour of copied tags differs from that of assigned tags for list-type tags and conditional replacements because each copy operation on a tag overrides any previous operations.  While this avoids duplicate list items when copying groups of tags from a file containing redundant information, it also prevents values of different tags from being copied into the same list when this is the intent.  So a -addTagsFromFile option is provided which allows copying of multiple tags into the same list.  eg)
exiftool -addtagsfromfile @ '-subject<make' '-subject<model' ...
Similarly, -addTagsFromFile must be used when conditionally replacing a tag to prevent overriding earlier conditions.
Other than these differences, the -tagsFromFile and -addTagsFromFile options are equivalent.
6) The -a option (allow duplicate tags) is always in effect when copying tags from SRCFILE, but the highest priority tag is always copied last so it takes precedence.
7) Structured tags are copied by default when copying tags.  See the -struct option for details.
8) With the redirection feature, copying a tag directly (ie. "'-DSTTAG<SRCTAG'") is not the same as interpolating its value inside a string (ie. "'-DSTTAG<$SRCTAG'") for list-type tags, shortcut tags, tag names containing wildcards, or UserParam variables.  When copying directly, the values of each matching source tag are copied individually to the destination tag (as if they were separate assignments).  However, when interpolated inside a string, list items and the values of shortcut tags are concatenated (with a separator set by the -sep option), and wildcards are not allowed.  Also, UserParam variables are available only when interpolated in a string.  Another difference is that a minor warning is generated if a tag doesn't exist when interpolating its value in a string (with "$"), but isn't when copying the tag directly.
Finally, the behaviour is different when a destination tag or group of "All" is used.  When copying directly, a destination group and/or tag name of "All" writes to the same family 1 group and/or tag name as the source.  But when interpolated in a string, the identity of the source tags are lost and the value is written to all possible groups/tags.  For example, the string form must be used in the following command since the intent is to set the value of all existing date/time tags from "CreateDate":
exiftool '-time:all<$createdate' -wm w FILE
-x TAG (-exclude) Exclude the specified tag.  There may be multiple -x options.  This has the same effect as --TAG on the command line.  See the --TAG documentation above for a complete description.
Note that trailing spaces are removed from extracted values for most output text formats.  The exceptions are -b, -csv, -j and -X.
-args (-argFormat) Output information in the form of exiftool arguments, suitable for use with the -@ option when writing.  May be combined with the -G option to include group names.  This feature may be used to effectively copy tags between images, but allows the metadata to be altered by editing the intermediate file ("out.args" in this example):
exiftool -args -G1 --filename --directory src.jpg > out.args exiftool -@ out.args -sep ', ' dst.jpg
Note:  Be careful when copying information with this technique since it is easy to write tags which are normally considered "unsafe". For instance, the FileName and Directory tags are excluded in the example above to avoid renaming and moving the destination file. Also note that the second command above will produce warning messages for any tags which are not writable.
As well, the -sep option should be used as in the second command above to maintain separate list items when writing metadata back to image files, and the -struct option may be used when extracting to preserve structured XMP information.
-b, --b (-binary, --binary) Output requested metadata in binary format without tag names or descriptions (-b or -binary).  This option is mainly used for extracting embedded images or other binary data, but it may also be useful for some text strings since control characters (such as newlines) are not replaced by '.' as they are in the default output. By default, list items are separated by a newline when extracted with the -b option, but this may be changed (see the -sep option for details).  May be combined with -j, -php or -X to extract binary data in JSON, PHP or XML format, but note that "unsafe" tags must be specified explicitly to be extracted as binary in these formats.
With a leading double dash (--b or --binary), tags which contain binary data are suppressed in the output when reading.
-c FMT (-coordFormat) Set the print format for GPS coordinates.  FMT uses the same syntax as a "printf" format string.  The specifiers correspond to degrees, minutes and seconds in that order, but minutes and seconds are optional.  For example, the following table gives the output for the same coordinate using various formats:
FMT                  Output -------------------    ------------------ "%d deg %d' %.2f"\"    54 deg 59' 22.80"  (default for reading) "%d %d %.8f"           54 59 22.80000000  (default for copying) "%d deg %.4f min"      54 deg 59.3800 min "%.6f degrees"         54.989667 degrees
1) To avoid loss of precision, the default coordinate format is different when copying tags using the -tagsFromFile option.
2) If the hemisphere is known, a reference direction (N, S, E or W) is appended to each printed coordinate, but adding a "+" to the format specifier (eg. "%+.6f") prints a signed coordinate instead.
3) This print formatting may be disabled with the -n option to extract coordinates as signed decimal degrees.
-charset [[TYPE=]CHARSET] If TYPE is "ExifTool" or not specified, this option sets the ExifTool character encoding for output tag values when reading and input values when writing, with a default of "UTF8".  If no CHARSET is given, a list of available character sets is returned.  Valid CHARSET values are:
CHARSET     Alias(es)        Description ----------  ---------------  ---------------------------------- UTF8        cp65001, UTF-8   UTF-8 characters (default) Latin       cp1252, Latin1   Windows Latin1 (West European) Latin2      cp1250           Windows Latin2 (Central European) Cyrillic    cp1251, Russian  Windows Cyrillic Greek       cp1253           Windows Greek Turkish     cp1254           Windows Turkish Hebrew      cp1255           Windows Hebrew Arabic      cp1256           Windows Arabic Baltic      cp1257           Windows Baltic Vietnam     cp1258           Windows Vietnamese Thai        cp874            Windows Thai DOSLatinUS  cp437            DOS Latin US DOSLatin1   cp850            DOS Latin1 DOSCyrillic cp866            DOS Cyrillic MacRoman    cp10000, Roman   Macintosh Roman MacLatin2   cp10029          Macintosh Latin2 (Central Europe) MacCyrillic cp10007          Macintosh Cyrillic MacGreek    cp10006          Macintosh Greek MacTurkish  cp10081          Macintosh Turkish MacRomanian cp10010          Macintosh Romanian MacIceland  cp10079          Macintosh Icelandic MacCroatian cp10082          Macintosh Croatian
TYPE may be "FileName" to specify the encoding of file names on the command line (ie. FILE arguments).  In Windows, this triggers use of wide-character i/o routines, thus providing support for Unicode file names.  See the "WINDOWS UNICODE FILE NAMES" section below for details.
Other values of TYPE listed below are used to specify the internal encoding of various meta information formats.
TYPE       Description                                  Default ---------  -------------------------------------------  ------- EXIF       Internal encoding of EXIF "ASCII" strings    (none) ID3        Internal encoding of ID3v1 information       Latin IPTC       Internal IPTC encoding to assume when        Latin IPTC:CodedCharacterSet is not defined Photoshop  Internal encoding of Photoshop IRB strings   Latin QuickTime  Internal encoding of QuickTime strings       MacRoman RIFF       Internal encoding of RIFF strings            0
See <https://exiftool.org/faq.html#Q10> for more information about coded character sets, and the Image::ExifTool Options for more details about the -charset settings.
-csv[[+]=CSVFILE] Export information in CSV format, or import information if CSVFILE is specified.  When importing, the CSV file must be in exactly the same format as the exported file.  The first row of the CSVFILE must be the ExifTool tag names (with optional group names) for each column of the file, and values must be separated by commas.  A special "SourceFile" column specifies the files associated with each row of information (and a SourceFile of "*" may be used to define default tags to be imported for all files which are combined with any tags specified for the specific SourceFile processed). The -csvDelim option may be used to change the input/output field delimiter if something other than a comma is required.
The following examples demonstrate basic use of the -csv option:
# generate CSV file with common tags from all images in a directory exiftool -common -csv dir > out.csv
# update metadata for all images in a directory from CSV file exiftool -csv=a.csv dir
Empty values are ignored when importing (unless the -f option is used and the API MissingTagValue is set to an empty string, in which case the tag is deleted).  Also, FileName and Directory columns are ignored if they exist (ie. ExifTool will not attempt to write these tags with a CSV import).  To force a tag to be deleted, use the -f option and set the value to "-" in the CSV file (or to the MissingTagValue if this API option was used).  Multiple databases may be imported in a single command.
When exporting a CSV file, the -g or -G option adds group names to the tag headings.  If the -a option is used to allow duplicate tag names, the duplicate tags are only included in the CSV output if the column headings are unique.  Adding the -G4 option ensures a unique column heading for each tag.  The -b option may be added to output binary data, encoded in base64 if necessary (indicated by ASCII "base64:" as the first 7 bytes of the value).  Values may also be encoded in base64 if the -charset option is used and the value contains invalid characters.
When exporting specific tags, the CSV columns are arranged in the same order as the specified tags provided the column headings exactly match the specified tag names, otherwise the columns are sorted in alphabetical order.
When importing from a CSV file, only files specified on the command line are processed.  Any extra entries in the CSV file are ignored.
List-type tags are stored as simple strings in a CSV file, but the -sep option may be used to split them back into separate items when importing.
Special feature:  -csv+=CSVFILE may be used to add items to existing lists.  This affects only list-type tags.  Also applies to the -j option.
Note that this option is fundamentally different than all other output format options because it requires information from all input files to be buffered in memory before the output is written.  This may result in excessive memory usage when processing a very large number of files with a single command.  Also, it makes this option incompatible with the -w option.  When processing a large number of files, it is recommended to either use the JSON (-j) or XML (-X) output format, or use -p to generate a fixed-column CSV file instead of using the -csv option.
-csvDelim STR Set the delimiter for separating CSV entries for CSV file input/output via the -csv option.  STR may contain "\t", "\n", "\r" and "\\" to represent TAB, LF, CR and '\' respectively.  A double quote is not allowed in the delimiter.  Default is ','.
-d FMT (-dateFormat) Set the format for date/time tag values.  The FMT string may contain formatting codes beginning with a percent character ("%") to represent the various components of a date/time value.  The specifics of the FMT syntax are system dependent -- consult the "strftime" man page on your system for details.  The default format is equivalent to "%Y:%m:%d %H:%M:%S".  This option has no effect on date-only or time-only tags and ignores timezone information if present.  Only one -d option may be used per command.  Requires POSIX::strptime or Time::Piece for the inversion conversion when writing.
-D (-decimal) Show tag ID number in decimal when extracting information.
-E, -ex, -ec (-escapeHTML, -escapeXML, -escapeC) Escape characters in output tag values for HTML (-E), XML (-ex) or C (-ec).  For HTML, all characters with Unicode code points above U+007F are escaped as well as the following 5 characters: & (&amp;) ' (&#39;) " (&quot;) > (&gt;) and < (&lt;).  For XML, only these 5 characters are escaped.  The -E option is implied with -h, and -ex is implied with -X.  For C, all control characters and the backslash are escaped.  The inverse conversion is applied when writing tags.
-f (-forcePrint) Force printing of tags even if their values are not found.  This option only applies when specific tags are requested on the command line (ie. not with wildcards or by "-all").  With this option, a dash ("-") is printed for the value of any missing tag, but the dash may be changed via the API MissingTagValue option.  May also be used to add a 'flags' attribute to the -listx output, or to allow tags to be deleted when writing with the -csv=CSVFILE feature.