forg is a file organizer, that allows to organize and move files based on filetype or any other rule, such as naming conventions.
It's a CLI tool that tries to make the process of organizing your files much easier and configured to you own liking, is it a hierarchical structure or fully based on filetype.
cmakejust(optional)
- Create the whole directory structure
- Organize files by filetype
- Organize files by naming conventions (tags)
- Preview the process
- Remove duplicate files
File Organizer
Usage: forg [options] <src> <dest> <mode>
Options:
-d, --dry Preview actions
-r, --rm Remove duplicate files
-h, --help Show this message
-V, --verbose Enable verbosity
Example 1: Remove duplicates
forg -r /home/user/Downloads /home/user/FilesThis will move all files from Downloads/ to Files/, organize them by filetype and remove any duplicates from the Downloads/ directory.
Example 2: Preview
forg.sh -V /home/user/Downloads /home/user/FilesThis will preview move for all files from Downloads/ to Files/.
This script reads the forg.conf at ~/.local/share, by default.
# Tags
tag:agreement=docs/legal/
tag:backup=backups/
tag:case=docs/legal/
# Extensions
ext:7z=archives/compressed/
ext:aa=media/audiobooks/
ext:aac=media/music/
By default, the auto mode is set where tags precede extensions. In this case, files starting with agreement-myfile.docx will be moved to docs/legal/. However, if the agreement tag was not set, and an extension is set it's going to be moved to the extension's configured path.
git clone https://github.com/aocoronel/forg
cd forg && just release
cd build && sudo make installYou can either run just build or:
cmake -DCMAKE_BUILD_TYPE=Release -B build .
cmake --build buildThis script has been only tested in a Linux Machine.
This repository is licensed under the MIT License, a very permissive license that allows you to use, modify, copy, distribute and more.