The organizer.sh
script automates the process of organizing files within a specified directory. It sorts files into subfolders based on their file types, helping users keep their directories clean and organized.
- Automatic Sorting: Organizes files into subfolders for various types:
- Images
- Documents
- Videos
- Music
- Archives
- Others
- Flexible Usage: Can be run in the current working directory or a specified directory.
- Error Handling: Displays an error message if the specified directory does not exist.
- This script is designed for Unix-like operating systems (Linux, macOS) with Bash installed.
- Ensure you have the necessary permissions to create folders and move files in the target directory.
- For Windows Users: You can run this script using Windows Subsystem for Linux (WSL).
-
Clone the repository (if applicable):
git clone https://github.com/mohamedtalhaouii/Automated-Folder-Organizer.git cd Automated-Folder-Organizer
-
Download the script: You can download the script directly from the repository.
-
Make the script executable:
chmod +x organizer.sh
To organize files in the current directory:
./organizer.sh
To specify a different directory:
./organizer.sh /path/to/your/directory
If you want to organize files in the ~/Downloads
directory:
./organizer.sh ~/Downloads
To run the organizer.sh
script on Windows using WSL:
-
Install WSL (if you haven't already):
- Open PowerShell as an administrator and run:
wsl --install
- This will install WSL and the default Linux distribution.
- Open PowerShell as an administrator and run:
-
Open WSL:
- You can launch WSL by typing
wsl
in your Windows command prompt or by searching for your installed Linux distribution (e.g., Ubuntu) in the Start menu.
- You can launch WSL by typing
-
Navigate to the folder where you have the
organizer.sh
script using the WSL terminal. -
Run the script as you would in any Linux environment:
./organizer.sh
You can modify the script to add more file types or change the folder structure as per your preferences.
- Images:
.jpg
,.jpeg
,.png
,.gif
,.bmp
,.tiff
,.svg
.avif
,.ico
- Documents:
.pdf
,.doc
,.docx
,.txt
,.ppt
,.pptx
,.xls
,.xlsx
,.epub
- Videos:
.mp4
,.mkv
,.avi
,.mov
,.wmv
,.flv
- Music:
.mp3
,.wav
,.aac
,.flac
,.ogg
- Archives:
.zip
,.tar.gz
,.tar.bz2
,.rar
,.7z
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any suggestions or improvements.