If I have the actual file and a Bash shell in Mac or Linux, how can I query the cert file for when it will expire? Not a web site, but actually the certificate file itself,
Same as accepted answer, But note that it works even with .crt file and not just .pem file, just in case if you are not able to find .pem file location.