This is a simple Bash script that automatically organizes a cluttered folder (like Downloads) by sorting files into subfolders based on type images, documents, videos, and more.
Most people's Downloads folders quickly become a mess of mixed file types. Manually sorting them is time-consuming and annoying.
This Bash script automatically:
- Detects file types
- Creates subfolders (
images/,documents/, etc.) - Moves files into the correct folder
Downloads/
├── file.jpg
├── resume.pdf
├── archive.zip
└── [messy files everywhere]
Downloads/
├── images/
│ └── file.jpg
├── documents/
│ └── resume.pdf
├── archives/
│ └── archive.zip
└── [everything organized!]
The script:
- Takes a folder path as input (defaults to
Downloads) - Creates subfolders like
images/,documents/,videos/,archives/ - Moves files based on their extensions
| File Extension | Moved To Folder |
|---|---|
.jpg, .png |
images/ |
.pdf, .docx |
documents/ |
.mp4, .mkv |
videos/ |
.zip, .rar |
archives/ |
| Other file types | others/ |
git clone https://github.com/CharlesMCMaponya/folder-organizer.git
cd folder-organizerchmod +x organize.shbash organize.shIt will organize your Downloads folder by default. You can change the folder path in the script.
I created this tool to solve a real problem: my messy Downloads folder. It also helped me practice Bash scripting, file handling, and GitHub project structure — while making my desktop cleaner and more productive.
folder-organizer/
├── organize.sh # Main script
├── README.md # Project info
└── demo/
├── terminal-demo.gif # Terminal running
└── organized-demo.gif # Files organized
Charles Mosehla Maponya

