This function is useful when you need to know the fingerprint of your ssh keys because you have too many keys across too many systems or you're verifying your key use against a particular system/service.
Add this to your .bashrc/.bash_profile/.profile or whereever you keep your shell functions. Works in bash, have not verified use in zsh, csk, ksh, fish, etc.
# fingerprint an ssh key
function fingerprint(){
if [ $# -eq 0 ]; then
echo "usage: fingerprint [md5|sha256] <id_rsa.pub path>"
return 1
# default to md5
elif [ $# -eq 1 ]; then
ssh-keygen -E md5 -lf "${1}"
# else run what is specified
elif [ $# -eq 2 ]; then
ssh-keygen -E "${1}" -lf "${2}"
fi
}