It’s simple, just run this command
$ openssl req -noout -text -in example.csr | grep 'Signature Algorithm' Signature Algorithm: sha256WithRSAEncryption
If the value is sha256WithRSAEncryption, the certificate is using SHA-256 (also known as SHA-2). Another common value is sha1WithRSAEncryption, that means the certificate is signed with SHA-1.