Plugin catalog
file_hash
Adds SHA-1 and SHA-256 hashes for each file to default and long listings.
↓ on this page
file_hash adds the SHA-1 and SHA-256 of each file to a listing. Turn it on when you need to compare files or check a download against a published hash. Directories stay bare.
lla -l --hide-group <dir> with only file_hash enabled.Turn it on
# ~/.config/lla/config.toml
enabled_plugins = ["file_hash"]Or run this once. It saves the same setting, so the plugin stays on until you run lla --disable-plugin file_hash.
lla --enable-plugin file_hashOutput appears in the default and long views (formats = ["default", "long"]), and in the table view, which uses the long format. The default view prints the first 8 characters of each hash, and the long view prints all of them.
The plugin adds two string fields, sha1 and sha256. They always hold the full hash. Use JSON in scripts, because the labels stay colored even with --no-color.
lla --json | jq -r '.[] | select(.name=="README.md") | .plugin.sha256'You can also add them as columns. The plugin's block still prints with each row.
[formatters.table]
columns = ["name", "size", "field:sha256"]Actions
| Action | What it does |
|---|---|
help | Prints usage. |
lla plugin run file_hash helphelp isn't interactive, so it works without a TTY. Running it also enables the plugin and saves that setting.
Example
lla.gitignore
┌─
│ SHA1 61bb15bc
│ SHA256 bd326839
└─lla -l --hide-group-rw-r--r-- 17B Aug 13 05:21 you .gitignore
┌─
│ SHA1 61bb15bcba8a888753fcbe9f9b8511252582e25d
│ SHA256 bd326839f62a577e3e3b33089581b586fc3f4b8770f6ba5f1f8a491bdf36cd12
└─Settings
The plugin reads ~/.config/lla/plugins/file_hash/config.toml.
[colors]
sha1 = "bright_green"
sha256 = "bright_yellow"
[cache]
enabled = true
max_entries = 10000The [colors] table also takes success, info and name. Hashes are cached in cache.toml in the same directory, keyed by path, size and modified time, so a changed file gets a new hash.