{"id":31650473,"url":"https://github.com/waheed-phy/linux-file-management-toolkit","last_synced_at":"2026-05-09T02:09:21.717Z","repository":{"id":317720710,"uuid":"1068572445","full_name":"waheed-phy/linux-file-management-toolkit","owner":"waheed-phy","description":"A collection of powerful bash and Python scripts to organize files, find duplicates, search bookmarks, and rename files by metadata on Linux. Automate your file management tasks.","archived":false,"fork":false,"pushed_at":"2025-10-02T15:34:05.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-02T17:37:48.803Z","etag":null,"topics":["bash","duplicate-images","file-management","linux","oragnize-files","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waheed-phy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-02T15:28:24.000Z","updated_at":"2025-10-02T15:44:01.000Z","dependencies_parsed_at":"2025-10-06T07:01:46.381Z","dependency_job_id":null,"html_url":"https://github.com/waheed-phy/linux-file-management-toolkit","commit_stats":null,"previous_names":["waheed-phy/linux-file-management-toolkit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/waheed-phy/linux-file-management-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed-phy%2Flinux-file-management-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed-phy%2Flinux-file-management-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed-phy%2Flinux-file-management-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed-phy%2Flinux-file-management-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waheed-phy","download_url":"https://codeload.github.com/waheed-phy/linux-file-management-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed-phy%2Flinux-file-management-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278742889,"owners_count":26037915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","duplicate-images","file-management","linux","oragnize-files","shell"],"created_at":"2025-10-07T08:29:53.595Z","updated_at":"2025-10-07T08:29:56.638Z","avatar_url":"https://github.com/waheed-phy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux File Management Toolkit\n\nA comprehensive collection of bash and Python scripts for organizing, managing, and cleaning up files on Linux systems. Perfect for dealing with messy downloads folders, duplicate images, unorganized media libraries, and more.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Shell Script](https://img.shields.io/badge/shell_script-%23121011.svg?style=flat\u0026logo=gnu-bash\u0026logoColor=white)](https://www.gnu.org/software/bash/)\n[![Python](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/)\n\n## 📋 Table of Contents\n\n- [Features](#features)\n- [Scripts Overview](#scripts-overview)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Requirements](#requirements)\n- [Contributing](#contributing)\n- [License](#license)\n\n## ✨ Features\n\n- 🗂️ **Organize files by extension** - Automatically sort files into folders\n- 🔍 **Find specific files** - Search through thousands of HTML files for bookmarks\n- 🖼️ **Remove duplicate images** - Keep only highest resolution versions\n- 📝 **Rename by metadata** - Rename PDF and MP3 files using their title metadata\n- 🚀 **Fast and efficient** - Handle thousands of files quickly\n- 🛡️ **Safe operations** - Move instead of delete, with preview options\n\n## 📜 Scripts Overview\n\n### 1. Organize Files by Extension (`organize_files.sh`)\n\nAutomatically organizes files into folders based on their file extensions.\n\n**What it does:**\n- Scans a directory for all files\n- Creates folders named after each file extension (e.g., `pdf`, `jpg`, `txt`)\n- Moves files into their respective extension folders\n- Files without extensions go to `no_extension` folder\n- Skips directories and the script itself\n\n**Usage:**\n```bash\n# Organize current directory\n./organize_files.sh\n\n# Organize specific directory\n./organize_files.sh /path/to/messy/folder\n```\n\n**Example:**\n```\nBefore:\n/downloads/\n  ├── document.pdf\n  ├── photo.jpg\n  ├── song.mp3\n  └── notes.txt\n\nAfter:\n/downloads/\n  ├── pdf/\n  │   └── document.pdf\n  ├── jpg/\n  │   └── photo.jpg\n  ├── mp3/\n  │   └── song.mp3\n  └── txt/\n      └── notes.txt\n```\n\n---\n\n### 2. Find Bookmark Files (`find_bookmarks.sh`)\n\nSearches through thousands of HTML files to find your browser bookmarks based on specific website keywords.\n\n**What it does:**\n- Searches HTML files for specific website keywords\n- Identifies files containing 2+ matching keywords (configurable)\n- Copies potential bookmark files to a separate folder\n- Shows which keywords were found in each file\n\n**Default keywords:** gmail, google, matlab, hec, daad, daraz\n\n**Usage:**\n```bash\n./find_bookmarks.sh\n\n# Or specify a directory\n./find_bookmarks.sh /path/to/html/files\n```\n\n**Customize keywords:**\nEdit the `KEYWORDS` array in the script:\n```bash\nKEYWORDS=(\"gmail\" \"google\" \"your-site\" \"another-site\")\n```\n\n**Output:**\n- Creates `found_bookmarks/` folder\n- Copies matching files with detailed report\n- Shows match count for each file\n\n---\n\n### 3. Find and Remove Duplicate Images (`find_duplicate_images.py`)\n\nIntelligently finds duplicate images and keeps only the highest resolution version.\n\n**What it does:**\n- Detects **exact duplicates** (identical files)\n- Detects **visual duplicates** (similar images using perceptual hashing)\n- Compares image resolutions (width × height)\n- Keeps the highest resolution version\n- Moves duplicates to a `delete` folder for review\n\n**Supported formats:** PNG, JPG, JPEG\n\n**Usage:**\n```bash\n# Process current directory\npython3 find_duplicate_images.py\n\n# Process specific directory\npython3 find_duplicate_images.py /path/to/images\n```\n\n**How it works:**\n1. Scans all images in the directory\n2. Generates file hashes (MD5) for exact matches\n3. Generates perceptual hashes for visual similarity\n4. Groups duplicates together\n5. Compares resolutions and keeps the best quality\n6. Moves lower quality copies to `delete/` folder\n\n**Example output:**\n```\nFound 3 duplicate(s):\n  - photo_small.jpg: 921600 pixels\n  - photo_medium.jpg: 2073600 pixels\n  - photo_large.jpg: 8294400 pixels\n  ✓ Keeping: photo_large.jpg (8294400 pixels)\n  → Moved to delete: photo_small.jpg\n  → Moved to delete: photo_medium.jpg\n```\n\n---\n\n### 4. Rename Files by Metadata (`rename_by_metadata.sh`)\n\nRenames PDF and MP3 files based on their embedded metadata titles.\n\n**What it does:**\n- Reads the \"Title\" property from file metadata\n- Renames files to match their metadata title\n- Cleans filenames (removes invalid characters)\n- Handles duplicate names automatically\n- Skips files without titles\n\n**Supports:**\n- PDF files (using `pdfinfo` or `exiftool`)\n- MP3 files (using `id3v2` or `exiftool`)\n\n**Usage:**\n```bash\n# Rename PDF files\n./rename_by_metadata.sh /path/to/pdfs pdf\n\n# Rename MP3 files\n./rename_by_metadata.sh /path/to/music mp3\n\n# Use current directory\n./rename_by_metadata.sh . pdf\n```\n\n**Example:**\n```\nBefore: \n  ├── 1a2b3c4d5e.pdf (Title: \"Research Paper on AI\")\n  ├── track01.mp3 (Title: \"Bohemian Rhapsody\")\n\nAfter:\n  ├── Research Paper on AI.pdf\n  ├── Bohemian Rhapsody.mp3\n```\n\n**Features:**\n- Color-coded output (green for success, yellow for warnings)\n- Prevents overwriting existing files\n- Shows detailed progress report\n- Safe: never deletes original files\n\n---\n\n## 🚀 Installation\n\n### 1. Clone the repository\n```bash\ngit clone https://github.com/yourusername/linux-file-management-toolkit.git\ncd linux-file-management-toolkit\n```\n\n### 2. Make scripts executable\n```bash\nchmod +x *.sh\n```\n\n### 3. Install dependencies\n\n**For all scripts:**\n```bash\n# Update package list\nsudo apt update\n```\n\n**For organize_files.sh and find_bookmarks.sh:**\nNo additional dependencies needed (uses built-in bash tools)\n\n**For find_duplicate_images.py:**\n```bash\n# Install Python3 and pip (if not already installed)\nsudo apt install python3 python3-pip\n\n# Install Pillow library\npip3 install pillow\n```\n\n**For rename_by_metadata.sh:**\n\nOption 1 - PDF and MP3 specific tools:\n```bash\n# For PDF files\nsudo apt install poppler-utils\n\n# For MP3 files\nsudo apt install id3v2\n```\n\nOption 2 - Universal tool (works for both):\n```bash\nsudo apt install libimage-exiftool-perl\n```\n\n---\n\n## 📦 Requirements\n\n### System Requirements\n- Linux-based operating system (Ubuntu, Debian, Fedora, Arch, etc.)\n- Bash shell (version 4.0+)\n- Python 3.6+ (for image duplicate finder)\n\n### Dependencies by Script\n\n| Script | Dependencies | Install Command |\n|--------|-------------|-----------------|\n| `organize_files.sh` | None (built-in) | - |\n| `find_bookmarks.sh` | None (built-in) | - |\n| `find_duplicate_images.py` | Python3, Pillow | `pip3 install pillow` |\n| `rename_by_metadata.sh` | pdfinfo, id3v2 or exiftool | `sudo apt install poppler-utils id3v2` |\n\n---\n\n## 💡 Usage Tips\n\n### Best Practices\n\n1. **Always test on a small folder first** before running on large directories\n2. **Review moved/deleted files** before permanently removing them\n3. **Backup important data** before running batch operations\n4. **Check script output** for errors or warnings\n\n### Common Use Cases\n\n**Cleaning up Downloads folder:**\n```bash\ncd ~/Downloads\n./organize_files.sh\n```\n\n**Finding lost bookmarks:**\n```bash\n./find_bookmarks.sh ~/Documents/old_browser_data\n```\n\n**Organizing photo collection:**\n```bash\npython3 find_duplicate_images.py ~/Pictures\n```\n\n**Fixing messy music library:**\n```bash\n./rename_by_metadata.sh ~/Music mp3\n```\n\n### Combining Scripts\n\nYou can chain scripts together for powerful workflows:\n\n```bash\n# 1. Organize files by extension\n./organize_files.sh ~/Downloads\n\n# 2. Find duplicates in images folder\npython3 find_duplicate_images.py ~/Downloads/jpg\n\n# 3. Rename MP3 files by metadata\n./rename_by_metadata.sh ~/Downloads/mp3 mp3\n```\n\n---\n\n## 🔧 Customization\n\n### Modify Keywords in find_bookmarks.sh\n\nEdit line 18 to add your own keywords:\n```bash\nKEYWORDS=(\"your-site\" \"another-site\" \"custom-keyword\")\n```\n\n### Change Minimum Match Count\n\nEdit line 36 to require more or fewer keyword matches:\n```bash\nif [ $matches -ge 2 ]; then  # Change 2 to your preferred number\n```\n\n### Adjust Perceptual Hash Size\n\nIn `find_duplicate_images.py`, line 18:\n```python\nimg = img.resize((8, 8), Image.Resampling.LANCZOS)  # Increase for stricter matching\n```\n\n---\n\n## 🐛 Troubleshooting\n\n### \"Permission denied\" error\n```bash\nchmod +x script_name.sh\n```\n\n### \"Command not found\" for Python script\n```bash\npython3 script_name.py  # Use python3 instead of python\n```\n\n### PDF metadata not found\n```bash\n# Test if pdfinfo works\npdfinfo your_file.pdf\n\n# If not, install it\nsudo apt install poppler-utils\n```\n\n### MP3 metadata not found\n```bash\n# Test if id3v2 works\nid3v2 -l your_file.mp3\n\n# If not, install it\nsudo apt install id3v2\n```\n\n---\n\n## 📝 Example Workflows\n\n### Workflow 1: Complete Download Folder Cleanup\n```bash\ncd ~/Downloads\n\n# Step 1: Organize by extension\n./organize_files.sh\n\n# Step 2: Clean up images\npython3 find_duplicate_images.py jpg/\npython3 find_duplicate_images.py png/\n\n# Step 3: Rename media files\n./rename_by_metadata.sh pdf/ pdf\n./rename_by_metadata.sh mp3/ mp3\n```\n\n### Workflow 2: Find Lost Browser Data\n```bash\n# Organize HTML files first\n./organize_files.sh ~/Documents/old_data\n\n# Search for bookmarks\n./find_bookmarks.sh ~/Documents/old_data/html\n\n# Check the found_bookmarks folder\nls -lh ~/Documents/old_data/html/found_bookmarks/\n```\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Here's how you can help:\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature/improvement`)\n3. Make your changes\n4. Test thoroughly\n5. Commit your changes (`git commit -am 'Add new feature'`)\n6. Push to the branch (`git push origin feature/improvement`)\n7. Open a Pull Request\n\n### Ideas for Contributions\n- Add support for more file types\n- Improve duplicate detection algorithms\n- Add GUI interface\n- Create Windows PowerShell versions\n- Add more metadata sources\n- Improve error handling\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## ⭐ Support\n\nIf you find these scripts helpful, please consider:\n- Starring the repository ⭐\n- Sharing with others who might benefit\n- Reporting bugs or suggesting features\n- Contributing improvements\n\n---\n\n## 📧 Contact\n\nFor questions, suggestions, or issues:\n- Open an issue on GitHub\n- Submit a pull request\n- Star the repo if you find it useful!\n\n---\n\n## 🙏 Acknowledgments\n\n- Built for the Linux community\n- Inspired by common file management challenges\n- Uses standard Linux tools and Python libraries\n\n---\n\n**Made with ❤️ for Linux users who love automation**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaheed-phy%2Flinux-file-management-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaheed-phy%2Flinux-file-management-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaheed-phy%2Flinux-file-management-toolkit/lists"}