filebyte
A CLI tool to list files and directories with intelligent size formatting, advanced filtering and file analysis. Made in Rust
If you found this project interesting and want to help me out, buy me a coffee :)
Aliases
You can invoke the tool as any of the following:
filebyte— full namefbt— short alias
The commands below work identically with any of these names. For example:
Installation
Cargo (Recommended)
Automated Installation
- Clone the repository:
- Run the installer:
The installer will automatically:
- Install Rust if not present
- Build filebyte with optimizations
- Install it system-wide to
/usr/local/bin/filebyte
Arch Linux (AUR)
# Or any other AUR helper
!!! Note: I don't use Arch Linux anymore. I will keep publishing to the AUR but I won't test the packages. If you find a problem, please don't hesitate to contact me
Windows
- Install Rust from https://www.rust-lang.org/tools/install
- Clone the repository and run
install.bat:
git clone https://github.com/execRooted/filebyte.git
cd filebyte
.\install.bat
Manual Build
# Binary will be available at target/release/filebyte
Uninstallation
sudo ./uninstall.sh
Arch Linux
paru -R filebyte
# Or any AUR helper
Windows
cd filebyte
.\uninstall.bat
Usage
Basic Usage
# List files in current directory
# List files in specific directory
# Show directory tree
# Analyze a specific file
# Analyze a directory as a whole
Size Formatting
# Show permissions and modification dates (default)
# Show file sizes in auto-detected units
# Show file sizes in specific units
Advanced Filtering
# Search for specific files
# Exclude files
# Combine search and exclusion
# Filter by file size
# Filter by file age
# Show only empty files and directories
# Search inside file contents
# Delete or merge duplicate files
File Analysis
# Show comprehensive analysis for current directory
# Analyze a specific file in detail
# Analyze a directory's metadata
# Find duplicate files
# Find true duplicates by content hash (SHA-256, slower but accurate)
# Find true duplicates using MD5 for faster hashing
Disk Operations
# List all disks
# Analyze specific disk
# Disk info with custom size units
Sorting & Export
# Sort by different criteria
# Export results
Interactive Menu
# Launch interactive menu
The interactive menu provides a user-friendly interface with the following options:
| Option | Description |
|---|---|
| 1 | List files in current directory |
| 2 | Analyze a specific file |
| 3 | Analyze a directory |
| 4 | Find duplicate files |
| 5 | Show directory tree |
| 6 | List all disks |
| 7 | Search for files (regex) |
| 8 | Show file type statistics |
| 9 | Bit converter (bits, kbits, mbits, gbits, tbits) |
| 0 | Exit |
Directory-based prompts in the interactive menu display the current working directory and default to it when pressing Enter.
Bit Converter - Option 9 allows you to convert between bits and bytes:
- Input formats:
1000 bits,500 kbits,1.5 mbits,2 gbits - Shows conversions in both bits and bytes formats
The menu automatically clears the screen between operations for a clean interface.
Command Line Options
| Option | Short | Description |
|---|---|---|
--version |
-v |
Show version information |
--help |
-h |
Show help information |
--size <UNIT> |
-s |
Show file sizes with specified unit (auto, b/bytes, kb/kilobytes, mb/megabytes, gb/gigabytes, tb/terabytes) |
--tree |
-t |
Show directory tree |
--properties |
-p |
Show comprehensive file/directory analysis |
--no-color |
Disable colored output | |
--disk <DISK> |
-m |
Disk operations ('list' or specific disk name) |
--search <PATTERN> |
-e |
Search files using regex pattern |
--excluding <PATTERN> |
-x |
Exclude files matching regex pattern |
--extension <EXT> |
-E |
Only list files with the specified extension (e.g. rs, txt, pdf) |
--sort-by <CRITERIA> |
Sort by: name, size, date | |
--duplicates |
Find duplicate files | |
--content-dups |
Verify duplicates by content hash instead of size only (true duplicates) | |
--hash <ALGORITHM> |
Hash algorithm for content-based deduplication (sha256 or md5) |
|
--export <FILE> |
Export results to JSON/CSV | |
--file <FILE> |
-f |
Analyze a specific file |
--directory <DIR> |
-d |
Analyze a directory as a whole |
--recursive |
-r |
Enable recursive searching and analysis |
--max-depth <N> |
Limit recursive search depth (requires --recursive) |
|
--json |
Output results as JSON to stdout | |
--whole |
-w |
Analyze the path as a whole (auto-detects if file or directory) |
--interactive |
-i |
Enable interactive menu mode |
--lines |
-l |
Count lines in files |
--preview [MODE] |
-P |
Preview file contents (N, f/N, or l/N for first/last N lines) |
--exclude-dirs |
-X |
Exclude all directories from results |
--top <N> |
Show the N largest files in a directory | |
--ignore-hidden |
Skip hidden files and directories (dotfiles) | |
--stat |
Show a summary of directory statistics (file count, total size, etc.) | |
--larger-than <SIZE> |
Filter files larger than threshold (10MB, 1GB, 8 GB, 2MiB, 1GiB, or path to file) |
|
--smaller-than <SIZE> |
Filter files smaller than threshold (1KB, 500MB, 500 MB, 2MiB, 1GiB, or path to file) |
|
--equal-to <SIZE> |
Filter files equal to threshold (10MB, 1GB, 8 GB, 2MiB, 1GiB, or path to file) |
|
--older-than <DURATION> |
Filter files older than duration (30d, 2w, 1y, yyyy-mm-dd, 30 d) |
|
--newer-than <DURATION> |
Filter files newer than duration (7d, 1w, 7 d) |
|
--empty |
Show only empty files and directories | |
--content <PATTERN> |
Search for pattern inside file contents | |
--delete-duplicates |
Delete duplicate files, keeping the first occurrence | |
--merge-duplicates |
Merge duplicate files by hard linking | |
--force |
Skip confirmation prompts for destructive actions |
Examples
Everyday Usage
# Quick directory overview (shows permissions & dates)
# Find large files with sizes
# Analyze disk usage
# Find all PDFs
# List only files with a specific extension
# Recursively list only files with a specific extension
# Check a specific file's details
# Get directory metadata
# Search recursively through directories
# Recursively exclude hidden files and sort by size
# Count lines in all files in current directory
# Count lines recursively, excluding target directories
# Exclude all directories from output
# Find files larger than 100MB
# Find files smaller than 1KB
# Find files exactly matching a size
# Find files older than 30 days
# Find files newer than 1 week
# Show only empty files and directories
# Search for text inside files
# Recursively search for text inside files
# Recursively search for text inside files
# Delete duplicate files (keeps first occurrence)
# Merge duplicates by hard linking
# Recursively search for a file by name
# Gets the file info for foo and counts the lines of the bar file
# Gets the info for foo and bar
# Gets the info for foo and bar directory
Advanced Analysis
# Comprehensive file analysis
# Find and sort duplicates by size
# Exclude system files and sort by date
# Recursively analyze entire project structure
# Find all config files recursively
# Analyze path as whole (auto-detects file or directory)
# Search with full paths shown
# Preview file contents (first/last N lines)
Power User Tips
# Monitor large directories
# Find recently modified config files
# Disk space analysis
|
# Deep analysis of entire filesystem
|
# Find all executables recursively
# Quick file analysis - no flags needed!
Made by execRooted