Forrest logo
back to the sha1sum tool

sha1sum:tldr:0aa7a

sha1sum: Calculate and save the list of SHA1 checksums to a file.
$ sha1sum ${filename1 filename2 ---} > ${filename-sha1}
try on your machine

This command is used to calculate the SHA-1 hash value of one or more files and redirect the output to another file.

Here is a breakdown of the command:

  • sha1sum: This is the command-line utility used to calculate the SHA-1 hash value. It takes one or more file names as input.

  • ${filename1 filename2 ---}: This is a placeholder for the file names you want to calculate the SHA-1 hash for. You can replace this placeholder with actual file names separated by spaces. If you have multiple files, you would list them here.

  • >: This is the output redirection operator in the command line. It directs the output of the command to a file instead of displaying it in the terminal.

  • ${filename-sha1}: This is another placeholder for the file name where you want to save the SHA-1 hash value. You can replace this placeholder with the desired filename.

So, when you run the command with actual file names, for example:

sha1sum file1.txt file2.jpg > hashes.txt

It will calculate the SHA-1 hash values of file1.txt and file2.jpg, and save the results in hashes.txt. Each line in the hashes.txt file will contain the file name and its corresponding SHA-1 hash value.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the sha1sum tool