Skip to content

Basic Usage

Quick Start

Here are some common use cases to get you started quickly:

1. Basic Directory Scan

Generate a hash report for all files in a directory:

hashreport scan /path/to/directory

2. Scan with Specific Hash Algorithm

Use SHA-256 for better security:

hashreport scan --algorithm sha256 /path/to/directory

3. Filter by File Type

Scan only PDF files:

hashreport scan --include "*.pdf" /path/to/directory

4. Generate Multiple Formats

Create both CSV and JSON reports:

hashreport scan -f csv -f json /path/to/directory

Command Structure

The basic command structure is:

hashreport scan [OPTIONS] DIRECTORY

Core Commands

Scanning a Directory

To scan a directory and generate a hash report:

hashreport scan /path/to/directory

Choosing Hash Algorithm

You can specify which hash algorithm to use:

hashreport scan --algorithm sha256 /path/to/directory

To see available hash algorithms:

hashreport algorithms

Output Formats

hashreport supports CSV (default) and JSON output formats:

# Generate CSV report (default)
hashreport scan -f csv /path/to/directory

# Generate JSON report
hashreport scan -f json /path/to/directory

# Generate both formats
hashreport scan -f csv -f json /path/to/directory

Specifying Output Location

Control where reports are saved:

hashreport scan /path/to/directory -o /path/to/output/

Filtering Options

Size Filters

Filter files by size:

# Files larger than 1MB
hashreport scan --min-size 1MB /path/to/directory

# Files smaller than 1GB
hashreport scan --max-size 1GB /path/to/directory

# Files between 1MB and 1GB
hashreport scan --min-size 1MB --max-size 1GB /path/to/directory

Pattern Matching

Include or exclude files by pattern:

# Include only .txt files
hashreport scan --include "*.txt" /path/to/directory

# Exclude .tmp files
hashreport scan --exclude "*.tmp" /path/to/directory

# Use regex patterns
hashreport scan --regex --include ".*\.txt$" /path/to/directory

Processing Control

Control how files are processed:

# Limit number of files
hashreport scan --limit 100 /path/to/directory

# Disable recursive scanning
hashreport scan --no-recursive /path/to/directory

File Listing

Generate a list of files without calculating hashes:

hashreport filelist /path/to/directory

Viewing Reports

View report contents in a paginated format:

# View entire report
hashreport view hashreport_<timestamp>.csv

# Filter report entries
hashreport view hashreport_<timestamp>.csv -f "mydoc"

Comparing Reports

Compare two reports to identify changes:

# View differences between reports
hashreport compare old_report.csv new_report.csv

# Save comparison results
hashreport compare old_report.csv new_report.csv -o /path/to/output/

The comparison will show:

  • Modified files (hash changed)
  • Moved files (same hash, different location)
  • Added files (new in second report)
  • Removed files (missing in second report)

Configuration Management

hashreport settings can be managed using the config command:

View Settings

Display current configuration:

hashreport config show

Edit Settings

Open settings in your default text editor:

hashreport config edit

The editor used is determined by: 1. $VISUAL environment variable 2. $EDITOR environment variable 3. Platform default (vi/vim on Unix, notepad on Windows)

Settings are automatically validated when saved.

Getting Help

For detailed information about available options:

hashreport --help
hashreport scan --help

Advanced Features

Additional Resources