How to make GnuPG display full 8-byte/64-bit key ID?
Alternatively you can use:
gpg --keyid-format LONG -k 0xDEADBEEF
Or:
gpg --keyid-format 0xLONG -k 0xDEADBEEF
You can see the long key ID using the option --with-colons
(yes, very intuitive).
To print only the long key ID, use something like:
$ gpg --list-keys --with-colons XXXXXXXX | awk -F: '/^pub:/ { print $5 }'
Just to point out a sanely named option to remember,
GnuPG 2.2.13 on macOS Catalina 10.15.4, --list-signatures
option displays the key ID as well:
$ gpg --list-signatures