file-utils
File Utilities
A toolkit for common file operations using Python standard library only.
When to Use This Skill
Activate this skill when the user needs to:
- Find files matching certain criteria (pattern, size, date)
- Count lines in files (with optional pattern matching)
- Get detailed file information (size, type, encoding)
- Compare two files (text or binary)
Available Scripts
Always run scripts with --help first to see all available options.
| Script | Purpose |
|---|---|
find_files.py |
Find files by pattern, size, or date |
count_lines.py |
Count lines in files |
file_stats.py |
Get detailed file information |
compare_files.py |
Compare two files |
Decision Tree
Task → What do you need?
│
├─ Find files matching criteria?
│ └─ Use: find_files.py <path> --pattern "*.py"
│
├─ Count lines (or matches)?
│ └─ Use: count_lines.py <file>
│
├─ Get file information?
│ └─ Use: file_stats.py <file>
│
└─ Compare two files?
└─ Use: compare_files.py <file1> <file2>
Quick Examples
Find files:
python scripts/find_files.py . --pattern "*.py"
python scripts/find_files.py /var/log --pattern "*.log" --size +1M
python scripts/find_files.py . --modified-within 7d
Count lines:
python scripts/count_lines.py myfile.txt
python scripts/count_lines.py src/ --pattern "*.py" --total
python scripts/count_lines.py code.py --match "TODO"
File statistics:
python scripts/file_stats.py document.txt
python scripts/file_stats.py image.png --checksum
Compare files:
python scripts/compare_files.py old.txt new.txt
python scripts/compare_files.py file1.bin file2.bin --binary
python scripts/compare_files.py config1.yaml config2.yaml --unified
Size Suffixes
For find_files.py --size:
Bor no suffix: bytesK: kilobytes (1024 bytes)M: megabytesG: gigabytes
Prefixes:
+1M: larger than 1 MB-100K: smaller than 100 KB1M: exactly 1 MB (rarely used)
Time Formats
For find_files.py time filters:
7d: 7 days24h: 24 hours30m: 30 minutes2w: 2 weeks
Common Use Cases
- Find large log files:
find_files.py /var/log --pattern "*.log" --size +100M - Count code lines:
count_lines.py src/ --pattern "*.py" --total - Find recently modified:
find_files.py . --modified-within 1d - Check file encoding:
file_stats.py data.csv - Compare configs:
compare_files.py old.conf new.conf
Notes
- All scripts use Python standard library only (no external dependencies)
- Handles both text and binary files appropriately
- Encoding detection is best-effort for text files
- Symbolic links are followed by default
More from ivanvza/dspy-skills
web-scraper
Web scraping toolkit for extracting content from web pages. Fetch HTML, extract links, parse text content, and download page resources. Use when the user needs to scrape websites, extract data from web pages, gather links, or harvest text content.
19pentest-commands
This skill should be used when the user asks to "run pentest commands", "scan with nmap", "use metasploit exploits", "crack passwords with hydra or john", "scan web vulnerabilities with nikto", "enumerate networks", or needs essential penetration testing command references.
7json-tools
JSON processing toolkit for validating, formatting, querying, and comparing JSON data. Use when working with JSON files, API responses, configuration files, or any structured JSON data that needs parsing, validation, transformation, or comparison.
7web-fingerprint
Find and fingerprint web servers on a target. Use when asked to "find web servers", "fingerprint a website", "what's running on this web server", "identify web technologies", or "scan for web services".
7network-recon
Perform network reconnaissance including host discovery, port scanning, and service enumeration. Use when asked to "scan a network", "find hosts", "discover devices", "enumerate services", "recon a subnet", or "what's on my network".
6network-check
Network connectivity testing toolkit for checking host reachability, port availability, and DNS resolution. Use when diagnosing network issues, verifying service availability, testing connectivity to servers, or troubleshooting DNS problems.
5