$ shasum sha_example.txt
$ sha1sum sha_example.txt
$ sha256sum sha_example.txt
or
$ shasum -a 256 sha_example.txt
$ sha512sum sha_example.txt
To generate the SHA value for text on the console
$ sha256sum -t
This is test message (Enter)
Ctrl+d
regards,
T.Dhanasekar