Checksum Utils is a CLI tool to manage the checksum of your files, focused on NAS systems.
-
Download the latest release from the releases page according to your operating system.
-
Move and rename the downloaded executable to your PATH, so you can use it from anywhere.
mv ./checksum-utils_linux-amd64 /usr/local/bin/checksum-utils
-
Give it execute permissions if necessary:
chmod 0755 /usr/local/bin/checksum-utils
This command reads the files in a folder, gets their checksums, and creates a file with the .sha512 extension with it, so you can have a record of the checksum of that file.
Let's say you want to create the checksum files for your folder "documents":
├── ~
│ ├── documents
│ │ ├── document-1.pdf
│ │ ├── document-2.ppt
│ │ └── document-3.csv
│ ├── music
│ ├── pictures
│ └── videos
Use the command:
checksum-utils create ~/documents
This command will create a .sha512 checksum file for each file in your folder:
├── ~
│ ├── documents
│ │ ├── document-1.pdf
│ │ ├── document-1.pdf.sha512 <-- created by checksum-utils
│ │ │
│ │ ├── document-2.ppt
│ │ ├── document-2.ppt.sha512 <-- created by checksum-utils
│ │ │
│ │ ├── document-3.csv
│ │ └── document-3.csv.sha512 <-- created by checksum-utils
│ ├── music
│ ├── pictures
│ └── videos
This command reads the content of the files generated by the command "checksum-utils create ~/documents" and compares them with the original file to verify if the checksum remains the same.
Let's say you want to check the checksums of the files of your folder "documents":
├── ~
│ ├── documents
│ │ ├── document-1.pdf
│ │ ├── document-1.pdf.sha512
│ │ │
│ │ ├── document-2.ppt
│ │ ├── document-2.ppt.sha512
│ │ │
│ │ ├── document-3.csv
│ │ └── document-3.csv.sha512
│ ├── music
│ ├── pictures
│ └── videos
Use the command:
checksum-utils check ~/documents
The command will display the results of the comparation of the current checksum of the file with the one stored in the file with the .sha512 extension:
├── ~
│ ├── documents
│ │ ├── document-1.pdf ✅
│ │ │
│ │ ├── document-2.ppt ✅
│ │ │
│ │ └── document-3.csv ❌
│ ├── music
│ ├── pictures
│ └── videos
You must have golang installed on your system.
-
Clone the project:
git clone https://github.com/JMOrbegoso/checksum-utils.git
-
Install Go dependencies:
go mod download
-
Build:
make build
JMOrbegoso:
- Website: jmorbegoso.com
- Blog: blog.jmorbegoso.com
- Github: @JMOrbegoso
- LinkedIn: @jmorbegosodev
- Twitter: @JMOrbegosoDev