I can use the following command to display the certificate in a PEM file:
openssl x509 -in cert.pem -noout -text
But it will only display the information of the first certificate. A PEM file may also contain a certificate chain. How can I display all contained certificates?