theshell.ch/site/pages/cmd/interm/shasum.html
devitg d6d21025f1 Intermediate group: Added command shasum.
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@202 a672b425-5310-4d7a-af5c-997e18724b81
2018-11-15 13:36:14 +00:00

54 lines
1.3 KiB
HTML

---
layout: page
category-title: Intermediate commands
category-page: intermediate
tags: sha sums check
author: Gianmarco De Vita
title: shasum
previous-page: pages/cmd/interm/
next-page: pages/cmd/interm/
---
With <code>shasum</code> command you can work with SHA Checksums.
<pre>
shasum [flag] [file]
</pre>
<h3>Store the Checksum</h3>
You can store the output in a file by adding to the command line the string
output symbol "&gt;" and then the path and the name of the file.
<h3>Define the algorithm</h3>
The flag <code>-a</code> allows you to choose which algorithm to use when
defining the checksum of a file. The default algorithm is 1.
<pre>
shasum -a algorithm file
</pre>
<h3>Read in binary mode</h3>
The flag <code>-b</code> allows you to read files in binary mode.
<pre>
shasum -b file
</pre>
<h3>Check two SHA sums</h3>
You can verify wheter two checksums belong to the same file or not (and so
define wheter the two files are the same thing) wit the flag <code>-c</code>.
After storing the Checksums into two files (let say file1 and file2),
you can write to command as follows:
<pre>
shasum -c file1 file2
</pre>
<h3>Display help</h3>
Writing the command followed by the <code>-h</code> h flag will display a little
help paragraph with the main functions of this command.
<pre>
shasum -h
</pre>