git-annex-examinekey(1)
π git-annex-examinekey π
okay so this is one of the pages from the git-annex manual, bestie β git-annex-examinekey β and it's genuinely one of the cutest little plumbing commands out there. let's get into it π«Ά
β¨ NAME β¨
git-annex-examinekey β prints information from a key π
π¦ SYNOPSIS π¦
git annex examinekey [key ...]
πΈ DESCRIPTION πΈ
okay so picture this: you hand it a key, and it prints out all the info that can be figured out purely by looking at the key itself. no content reading, no detective work, just vibes and string parsing. it's giving lowkey genius honestly.
this one is a plumbing-level command, which is the fancy way of saying it's the building-block layer that other stuff gets built on top of. iykyk π§
π OPTIONS π
--format=valueβ use custom output formatting, bestie. you're the main character of your own output now β¨
the value here is a format string, and inside it ${var} gets expanded to the value of a variable. the whole system is so cute:
- to right-justify a variable with whitespace, use
${var;width} - to left-justify a variable, use
${var;-width} - to escape unusual characters (yes, including control characters π) in a variable, use
${escaped_var}
to generate a path from the top of the repository allll the way down to the git-annex object for a key, use ${objectpath}. and to generate the value of a git-annex pointer file for a key, use ${objectpointer}. obsessed.
these variables are also available for use in formats:
${key}${backend}${bytesize}${humansize}${keyname}${hashdirlower}${hashdirmixed}${mtime}β for the mtime field of a WORM key π${file}β when a filename is provided to examinekey
also, '\n' is a newline, '\000' is a NULL, etc. little escape-code moment π
the default output format is the same as --format='${escapedkey}\n' β except when you're outputting to a terminal, in which case control characters will be escaped. so the terminal doesn't get jump-scared fr fr.
--jsonβ enable JSON output π₯ this one is intended to be parsed by programs that use git-annex, so it's not really for your eyeballs, it's for the robots. each line of output is a JSON object.--json-error-messagesβ messages that would normally be output to standard error are included in the JSON instead. so like, the drama gets bundled into the data π--migrate-to-backend=backendβ attempt to migrate the input key to the new backend specified. if it's successful, it outputs information about the migrated key. otherwise, it outputs information about the input key. either way you get something, which is very generous of it.
β οΈ important caveat bestie: this only does fast migrations. it will not re-hash the content of a key or do any similar expensive operation. so don't come in expecting it to do heavy lifting π
one way to use it is to add an extension to a key:
git-annex examinekey SHA256--xxx --migrate-to-backend=SHA256E
--filename=foo.tar.gz
or to remove the extension from a key:
git-annex examinekey SHA256E--xxx.tar.gz
--migrate-to-backend=SHA256
--filename=nameβ the name of a file associated with the key, eg a work tree file π it does not need to exist, so no pressure, she's imaginary. this is needed when using--migrate-to-backendto add an extension to the key.--batchβ enable batch mode π in which a line containing a key is read from stdin, the information about it is output to stdout, and repeat. over and over. forever. slay.
in order to also provide the name of a file associated with the key, the line can be in the format "$key $file" β cute little two-for-one deal π
also the git-annex-common-options(1) can be used. so go wild with those too.
π SEE ALSO π
π§ AUTHOR π§
Joey Hess <id@joeyh.name> β icon, legend, the moment π
and that's the whole page bestie, no cap π«Ά this was git-annex-examinekey(1) from the git-annex manual, and if you're reading this in a terminal rn, the footer just says the same thing again β git-annex-examinekey(1) β so consider this your lil sign-off. go examine some keys, you got this β¨π
π¦ where this page comes from
- alpine 3.24: git-annex-doc 10.20261026-r0 Β· AGPL-3.0-or-later
- arch rolling: git-annex 10.20261026-2 Β· AGPL-3.0-only
- debian trixie: git-annex 10.20250416-2 Β· AGPL-3.0-or-later
- debian trixie: git-annex 10.20250416-2+deb13u1 Β· AGPL-3.0-or-later
- epel 10: git-annex 10.20250320-1.el10_0 Β· AGPL-3.0-or-later
- fedora 43: git-annex 10.20250630-4.fc43 Β· AGPL-3.0-or-later
- fedora 43: git-annex 10.20250929-5.fc43 Β· AGPL-3.0-or-later
- fedora 44: git-annex 10.20260115-1.fc44 Β· AGPL-3.0-or-later
- nixos 26.05: git-annex 10.20260421
- nixpkgs unstable: git-annex 10.20260421
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- ubuntu questing: git-annex 10.20250721-1
- ubuntu resolute: git-annex 10.20251029-1ubuntu1 Β· AGPL-3.0-or-later
- ubuntu stonking: git-annex 10.20251029-1ubuntu1 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms