Generating a SHA-256 hash from the Linux command line June 5, 2023 by Tarik echo will normally output a newline, which is suppressed with -n. Try this: echo -n foobar | sha256sum