Generating a SHA-256 hash from the Linux command line August 11, 2021 by ray echo will normally output a newline, which is suppressed with -n. Try this: echo -n foobar | sha256sum