Working with large file collections often requires splitting them into smaller chunks. You might be preparing datasets, batching assets for processing, archiving, or migrating data.
File Bucketer is a lightweight command-line tool that automatically distributes files from an input directory into a specified number of buckets, or into buckets with a defined maximum number of files. It supports both copying and moving files.
β¨ Features
- Automatically splits files from any input directory
- Choose either number of buckets or number of files per bucket
- Supports
copyandmoveoperations - Cross-platform binary (Windows, Linux, macOS)
- Informative terminal output with clear progress messages
π¦ Installation
- Go to the Releases page
- Download the
.taror.ziparchive containing the binary - Extract it
- Run:
Linux/macOS:
./bin/file-bucketer Windows:
.\bin\file-bucketer.bat π οΈ Usage
Linux/macOS:
./bin/file-bucketer <parameters> Windows:
.\bin\file-bucketer.bat <parameters> Parameters:
| Option | Short option | Description | Type | Required |
|---|---|---|---|---|
--input | -i | Input directory | String | yes |
--output | -o | Output directory. May not exist | String | yes |
--buckets | -b | Bucket count. Mutually exclusive with --count option. Must be present if --count option is not specified | Int | yes/no |
--count | -c | Count per bucket. Mutually exclusive with --buckets option. Must be present if --buckets option is not specified | Int | yes/no |
--transferOption | -t | Transfer type. Value should be one of copy, move. Defaults to copy | copy, move | no |
--help | -h | Usage info | - | no |
π Example
Imagine you want to split the files located in /home/bob/foo into 5 buckets and move them to /home/alice/foo:
./bin/file-bucketer \ -i /home/bob/foo \ -o /home/alice/foo \ -b 5 \ -t move Example output:
Got parameters: input: '/home/bob/foo' output: '/home/alice/foo' buckets: '5' count: 'calculated' transfer option: 'MOVE' Validating given input directory... Validate given output directory... Counting files under the directory... Found: 10 files. Preparing 5 buckets with at most 2 elements... Pouring into the buckets... Process completed. Result:
β― ls /home/alice/foo bucket_0 bucket_1 bucket_2 bucket_3 bucket_4 π Summary
If you need a straightforward utility to split files without writing your own scripts, File Bucketer provides a simple and efficient solution.
The project is fully open-source and available on Codeberg.
Feedback and contributions are welcome. Happy bucketing!
Top comments (0)