tarsha1sha1sum

How to use sha1sum to verify contents of a tarball


When I run this command:

tar -xOzf oresoftware-npp-0.0.1002.tgz | sort | sha1sum

I get this:

fadc89dd523fd54299aed689a90f73243c5336b8  -

does anyone know what the trailing dash - is supposed to represent?


Solution

  • sha1sum prints the SHA-1 hash, followed by the corresponding file name. In this case, it’s calculating the hash of the data on its standard input; it uses - as the file name to represent this.