How raul-2000/ogzf-repo works
Purpose and Entry Point
OGZF is a Linux command-line file organizer. Its sole executable implementation is [ogzf.sh](ogzf.sh); [README.md](README.md) defines its CLI contract and installation flow. It recursively scans a user-supplied root directory and places files into extension-based category folders.
Runtime and Dependencies
The utility runs under Bash on Linux and relies on standard GNU/POSIX shell utilities for traversal, filesystem operations, and path handling. It has no application server, database, package runtime, cloud infrastructure, or external API dependencies. Installation may expose [ogzf.sh](ogzf.sh) as /usr/local/bin/ogzf.
Invocation and Mode Selection
The shell entry point accepts a required main folder plus optional control arguments:
• Default mode copies files, preserving sources.
• --move / -m changes the terminal filesystem action from copy to move.
• Normal filtering treats the supplied comma-separated paths as exclusions.
• exclude-all reverses filtering semantics: only supplied paths are eligible.
Argument parsing and mode state belong in [ogzf.sh](ogzf.sh), while expected argument forms are documented in [README.md](README.md).
Recursive Discovery and Eligibility Boundary
The processing pipeline recursively traverses content below the target root. Before organizing a discovered file, OGZF applies either exclusion matching or inclusive-path matching. This filter boundary determines which source files enter the organizer and prevents explicitly excluded paths from being acted upon. The behavior is defined by the CLI semantics in [README.md](README.md) and implemented in [ogzf.sh](ogzf.sh).
Classification and Destination Layout
Eligible files are classified from their extension into Images, Videos, Documents, Spreadsheets, Audio, Archives, or Others. Classification maps each file to a category destination folder under the organization target. Unknown extensions are routed to Others. The category taxonomy is the central data model described in [README.md](README.md) and realized by [ogzf.sh](ogzf.sh).
Collision-Safe Materialization
Before writing a destination file, OGZF checks for existing names and generates numbered variants such as photo (1).jpg. This collision-resolution stage is a safety boundary: it avoids overwriting prior organized output. The final action then copies by default or moves only when explicitly requested. Both safety guarantees and duplicate behavior are specified in [README.md](README.md) and enforced by [ogzf.sh](ogzf.sh).
Operational Characteristics
The target directory is both the scan scope and filesystem boundary; all effects are local filesystem reads plus category-directory creation and copy/move writes. Copy mode is the recommended non-destructive path, while move mode intentionally removes original source locations after successful relocation. There are no persistent metadata stores, background workers, or network interactions.
Main entry points: ogzf.sh Argument parsing · README.md README
Components 13
CLI contract
Organization pipeline
- Argument parsing · Reads root, move mode, and path-list controls.
ogzf.sh - Target root scan · Discovers files beneath the supplied root directory.
ogzf.sh - Eligibility filter · Applies exclusions or exclude-all inclusion semantics.
ogzf.sh - Extension classifier · Maps extensions to Images, Videos, Documents, Spreadsheets, Audio, Archives, or Others.
ogzf.sh - Category destinations · Selects category folders under the organization target.
ogzf.sh - Collision resolver · Generates numbered destination names to prevent overwrites.
ogzf.sh - Copy action · Default non-destructive materialization.
ogzf.sh - Move action · Relocates eligible files when explicitly selected.
ogzf.sh
Local filesystem
- Source files · Files located within the user-supplied target root.
- Category folders · Created beneath the target root for organized output.
- Organized files · Collision-safe copied or moved output.
Connections 15
- README → ogzf.sh: documents
- ogzf.sh → Argument parsing: invokes
- Argument parsing → Target root scan: supplies root
- Source files → Target root scan: scan scope
- Target root scan → Eligibility filter: discovered files
- Argument parsing → Eligibility filter: filter mode and paths
- Eligibility filter → Extension classifier: eligible files
- Extension classifier → Category destinations: category
- Category destinations → Collision resolver: destination path
- Collision resolver → Copy action: default mode
- Collision resolver → Move action: --move / -m
- Category destinations → Category folders: creates/selects
- Copy action → Organized files: copies
- Move action → Organized files: moves
- Category folders → Organized files: contains