Meet GNUDir — a lightweight, open-source Bash utility that automatically sorts a messy folder into organized subdirectories by file type, with optional recursive cleanup and a one‑line install/run flow.
Overview
GNUDir Cleaner by BioKeyPer is a simple, dependable file organization script designed for Linux users who want a fast way to tidy downloads, project folders, or shared directories. It groups files into Images, Videos, Documents, Archives, Audio, and Application packages, reuses existing folders, and reports total runtime so you know how long cleanup took.
Key features
- Automatic categorization of common file types into named subdirectories.
- Recursive mode via
--recurseto traverse nested folders. - Idempotent behavior: existing subdirectories are reused and already-organized files are skipped.
- Graceful error handling: missing files are ignored rather than breaking the run.
- Runtime reporting so you can measure performance and iterate on customizations.
How it works
GNUDir uses standard Bash and find to locate files by extension and mv to relocate them into target folders. When you run ./gnudir.sh <directory> it processes the top level; add --recurse to scan subdirectories. The script is intentionally minimal so it’s easy to read, modify, and extend for additional file types or naming schemes. No external dependencies beyond a POSIX shell and coreutils.
Quick start
- Clone the repo
git clone [email protected]:biokeyper/GNUDir-Cleaner.git
- Enter the folder and make it executable
cd GNUDir-Cleaner
chmod +x ./gnudir.sh
- Run it
Top-level only:
./gnudir.sh ~/Downloads
Recursive:
./gnudir.sh ~/Downloads --recurse
Sample output shows per-category move times and a final summary like: Organization complete in directory: /home/user/Downloads in 3 seconds.
Customize and extend
GNUDir is built to be edited. Add or remove extensions, rename destination folders, or integrate size/age filters to tailor behavior. Planned improvements include verifying moves and cleaning empty directories, reporting total bytes moved, and an optional ASCII progress bar for visual feedback.
License and credits
GNUDir is released under the GNU Affero General Public License v3.0 and is hosted on GitHub for community contributions and issue tracking Github. Author: BioKeyPer with thanks to anonymous contributors and the Multus community.
Ready to try it? Clone the repo, run the script in a test folder, and adapt the extension lists to match your workflow. Github.