Usage Examples
Real-world scenarios and workflows with FileFortress CLI
This page provides practical examples and common workflows to help you get the most out of FileFortress CLI. Each example includes step-by-step instructions and expected outcomes.
Common Workflows
First-Time Setup Workflow
Complete walkthrough from installation to your first successful file search.
After installing FileFortress CLI, verify the installation:
filefortress --version
Expected output: Version number (e.g., "FileFortress CLI v1.2.3")
Get your registration code from the dashboard and initialize:
filefortress init --code YOUR_REGISTRATION_CODE --use-defaults
Expected output: "✓ Device successfully registered with ID: [device-id]"
Connect your Google Drive (or other cloud storage):
filefortress remotes add
Follow the interactive prompts to authenticate with your cloud provider.
Expected outcome: Browser opens for authentication, then returns to CLI with success message.
Check that your remote is connected and perform initial scan:
filefortress remotes list
filefortress remotes scan --full
Expected output: List showing your connected remote, followed by scan progress.
Search for files to verify everything is working:
filefortress find query --text "document" --limit 10
Expected output: Table showing up to 10 files containing "document" in their name or content.
Advanced Search Examples
Master the search functionality with these advanced examples.
Identify files larger than 50MB to free up storage space:
filefortress find query --size-min 50MB --format table
Use case: Storage cleanup and identifying large files across all your cloud accounts.
For even more detailed analysis, sort by size:
filefortress find query --size-min 10MB --format json | jq 'sort_by(.size) | reverse'
Find documents modified in the last 30 days:
filefortress find query --modified-after $(date -d "30 days ago" +%Y-%m-%d) --extension docx,pdf,pptx
Use case: Quickly locate recent work files for project reviews or backups.
Find files modified today:
filefortress find query --modified-after $(date +%Y-%m-%d)
Find all images across your cloud storage:
filefortress find query --extension jpg,jpeg,png,gif,bmp,tiff --limit 50
Find all spreadsheets containing "budget":
filefortress find query --text "budget" --extension xlsx,xls,csv
Find all code files:
filefortress find query --extension js,ts,py,java,cs,cpp,h --limit 100
Find large PDF reports from this year:
filefortress find query --text "report" --extension pdf --size-min 1MB --modified-after 2024-01-01
Find old large files (potential cleanup candidates):
filefortress find query --size-min 100MB --modified-before 2023-01-01
Find presentation files in specific cloud storage:
filefortress find query --extension pptx,ppt --remote "Google Drive" --text "meeting"
Find duplicate files using hash comparison (most accurate):
filefortress find duplicates --method hash --min-size 1MB
Find duplicate images:
filefortress find duplicates --method hash --extensions jpg,png,gif --group-by size
Find files with similar names (potential duplicates):
filefortress find duplicates --method name --min-size 100KB
Multi-Cloud Management Examples
Examples for managing files across multiple cloud storage providers.
Add multiple cloud storage providers:
# Add Google Drive
filefortress remotes add
# Follow prompts for Google Drive
# Add Dropbox
filefortress remotes add
# Follow prompts for Dropbox
# Add OneDrive
filefortress remotes add
# Follow prompts for OneDrive
# Verify all connections
filefortress remotes list --detailed
Search for the same file across all cloud providers:
filefortress find query --text "project proposal" --extension pdf
This will search across all connected cloud storage accounts and show which provider has the file.
Search specific providers only:
# Search only in Google Drive and Dropbox
filefortress find query --text "presentation" --remote "Google Drive"
filefortress find query --text "presentation" --remote "Dropbox"
Check quota usage across all providers:
filefortress quota status --detailed
Check specific provider quota:
filefortress quota status "Google Drive"
filefortress quota status "Dropbox"
filefortress quota status "OneDrive"
Scan all remotes to keep the index up-to-date:
# Scan all remotes
filefortress remotes scan --background
# Scan specific remote
filefortress remotes scan "Google Drive" --full
# Check scan status
filefortress remotes list
Regular Maintenance Tasks
Keep your FileFortress installation running smoothly with these maintenance routines.
# Check for CLI updates
filefortress update --check
# Quick scan of all remotes
filefortress remotes scan
# Check quota status
filefortress quota status
Purpose: Ensure you have the latest features and your file index is current.
# Full scan of all remotes
filefortress remotes scan --full
# Check for duplicate files
filefortress find duplicates --method hash --min-size 1MB
# Review large files
filefortress find query --size-min 50MB --format table
# Update CLI if needed
filefortress update
Purpose: Deep maintenance to identify duplicates and large files, ensure complete indexing.
# Review and clean configuration
filefortress config list
# Check device information
filefortress device info
# Review old files (potential cleanup)
filefortress find query --modified-before $(date -d "1 year ago" +%Y-%m-%d) --size-min 10MB
# Enrich metadata for better search
filefortress remotes enrich
# Sync quota information
filefortress quota sync
Purpose: Comprehensive maintenance including metadata enrichment and configuration review.
Troubleshooting Common Issues
Problem: Search commands return empty results even though files exist.
Solution:
# Check if remotes are connected
filefortress remotes list
# Perform full scan
filefortress remotes scan --full
# Try a broader search
filefortress find query --limit 10
Problem: Cloud storage connection fails or shows as disconnected.
Solution:
# Check remote status
filefortress remotes show "Remote Name"
# Remove and re-add the remote
filefortress remotes remove "Remote Name"
filefortress remotes add
# Check quota (might be rate limited)
filefortress quota status "Remote Name"
Problem: Commands fail with "device not registered" error.
Solution:
# Check device status
filefortress device info
# Re-initialize if needed
filefortress init --code YOUR_CODE --force
Automation Examples
Automate common tasks with scripts and scheduled commands.
Bash Scripts (Linux/macOS)
#!/bin/bash
# daily-check.sh
echo "=== FileFortress Daily Check ==="
echo "Date: $(date)"
# Check for updates
echo "Checking for updates..."
filefortress update --check
# Scan remotes
echo "Scanning remotes..."
filefortress remotes scan
# Check quota
echo "Checking quota status..."
filefortress quota status
echo "Daily check complete!"
#!/bin/bash
# find-large-files.sh
SIZE_THRESHOLD=${1:-100MB}
OUTPUT_FILE="large-files-$(date +%Y%m%d).csv"
echo "Finding files larger than $SIZE_THRESHOLD..."
filefortress find query --size-min "$SIZE_THRESHOLD" --format csv > "$OUTPUT_FILE"
echo "Results saved to $OUTPUT_FILE"
echo "Total large files found: $(wc -l < "$OUTPUT_FILE")"
PowerShell Scripts (Windows)
# weekly-maintenance.ps1
Write-Host "=== FileFortress Weekly Maintenance ===" -ForegroundColor Green
Write-Host "Date: $(Get-Date)" -ForegroundColor Yellow
# Update CLI
Write-Host "Updating CLI..." -ForegroundColor Cyan
& filefortress update
# Full scan
Write-Host "Performing full scan..." -ForegroundColor Cyan
& filefortress remotes scan --full
# Find duplicates
Write-Host "Finding duplicate files..." -ForegroundColor Cyan
& filefortress find duplicates --method hash --min-size 1MB
Write-Host "Weekly maintenance complete!" -ForegroundColor Green
Scheduled Tasks
# Edit crontab: crontab -e
# Daily scan at 9 AM
0 9 * * * /usr/local/bin/filefortress remotes scan
# Weekly full scan on Sundays at 2 AM
0 2 * * 0 /usr/local/bin/filefortress remotes scan --full
# Monthly quota check on 1st of month at 8 AM
0 8 1 * * /usr/local/bin/filefortress quota sync
Create scheduled tasks using Windows Task Scheduler:
- Open Task Scheduler
- Create Basic Task
- Set trigger (daily, weekly, etc.)
- Action: Start a program
- Program:
filefortress.exe
- Arguments:
remotes scan