{"id":21347052,"url":"https://github.com/yann39/unix-file-tagger","last_synced_at":"2026-04-12T02:35:47.776Z","repository":{"id":226484720,"uuid":"753067524","full_name":"Yann39/unix-file-tagger","owner":"Yann39","description":"Unix shell utility to add file tagging capability to Unix filesystem","archived":false,"fork":false,"pushed_at":"2024-03-07T19:47:55.000Z","size":606,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-03T11:30:42.875Z","etag":null,"topics":["c","file-tagging","shell","sqlite","sqlite3","unix","unix-shell"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yann39.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-02-05T12:05:28.000Z","updated_at":"2024-03-07T19:50:26.000Z","dependencies_parsed_at":"2024-03-30T15:45:34.397Z","dependency_job_id":null,"html_url":"https://github.com/Yann39/unix-file-tagger","commit_stats":null,"previous_names":["yann39/unix-file-tagger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Yann39/unix-file-tagger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yann39%2Funix-file-tagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yann39%2Funix-file-tagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yann39%2Funix-file-tagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yann39%2Funix-file-tagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yann39","download_url":"https://codeload.github.com/Yann39/unix-file-tagger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yann39%2Funix-file-tagger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31702580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"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":["c","file-tagging","shell","sqlite","sqlite3","unix","unix-shell"],"created_at":"2024-11-22T02:12:29.670Z","updated_at":"2026-04-12T02:35:47.729Z","avatar_url":"https://github.com/Yann39.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unix file tagger\n\nSimple **C / Shell** program that adds **file tagging** capability to **Unix** filesystem.\n\n![Version](https://img.shields.io/badge/Version-1.0.0-2AAB92.svg)\n![Static Badge](https://img.shields.io/badge/Last%20update-10%20Dec%202007-blue)\n\n---\n\n# Table of Contents\n\n* [About the project](#about-the-project)\n* [Usage](#usage)\n    * [Install](#install)\n    * [Compile](#compile)\n    * [Execute](#execute)\n    * [Uninstall](#uninstall)\n* [Technical details](#technical-details)\n    * [Application architecture](#application-architecture)\n    * [Functions](#functions)\n    * [Database](#database)\n* [Examples](#examples)\n* [License](#license)\n\n# About the project\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"doc/logo-c.svg\" alt=\"C logo\" height=\"102\"/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"doc/logo-bash.svg\" alt=\"Bash logo\" height=\"112\"/\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"doc/logo-sqlite.svg\" alt=\"Sqlite logo\" height=\"92\"/\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nThe purpose of this project was to build a program capable of adding semantic information to the Unix\nfile system through file tags. For example user will be able to tag files as `important`, `public`, `private`, `draft`, etc.\n\nApplication is in French and has been built on **December 2007** under **Linux Fedora Core 5**.\nI tried to respect **POSIX** standards as much as possible so it should be compatible with other distributions as well.\n\nIt uses simple **C** programs and **Shell** scripts.\n\nIt was originally compiled with **GCC** for **32** bits systems. I recompiled it recently for **64** bits systems.\n\n# Usage\n\n## Install\n\n1. Get the archive from this project (_bin/file-tagger.tar.gz_), then uncompress and extract it wherever you want (i.e. _/usr/local_)\n    ```bash\n    tar zxvf file-tagger.tar.gz -C /usr/local\n    ```\n2. From the application folder, execute the `configure.sh` file which will set permissions and create aliases (also in the _/etc/profile file_)\n    ```bash\n    cd /usr/local/file-tagger\n    ./configure.sh\n    ```\n   You can also do it manually if you prefer, just inspect the file.\n3. Run available commands, see [Execute](#execute)\n\n## Compile\n\n1. Make sure you have the right libraries (SQLite) to be able to compile the **C** files :\n    ```bash\n    sudo apt-get install sqlite3\n    sudo apt-get install libsqlite3-dev\n    ```\n\n2. Get the sources from this project (_src_ folder) then compile them :\n    ```bash\n    gcc src/AfficherTags.c -lsqlite3 -o AfficherTags\n    gcc src/AjouterTag.c -lsqlite3 -o AjouterTag\n    gcc src/AjouterTagIncompatibles.c -lsqlite3 -o AjouterTagIncompatibles\n    gcc src/SupprimerTag.c -lsqlite3 -o SupprimerTag\n    gcc src/SupprimerTagIncompatibles.c -lsqlite3 -o SupprimerTagIncompatibles\n    gcc src/ViderTableTags.c -lsqlite3 -o ViderTableTags\n    ```\n\n## Execute\n\nSimply use the available commands (once aliases have been created) :\n\n- `addtag file/directory tag` → add a tag on one or multiple files\n- `deltag file/directory tag` → remove a tag from one or multiple files\n- `addincompatibletags tag1 tag2` → set 2 tags as incompatible\n- `delincompatibletags tag1 tag2` → remove the incompatibility between 2 tags\n- `showtags` → show all tags in all tagged files\n- `delalltags` → remove all tags from all tagged files\n- `ls --tag [option] tag` → list files tagged with the specified tag\n- `rm --tag tag` → remove files tagged with the specified tag\n\nSee the [Examples](#examples) section.\n\n## Uninstall\n\n1. Remove the aliases by running the `uninstall.sh` script\n    ```bash\n    cd /usr/local/file-tagger\n    ./uninstall.sh\n    ```\n2. Remove the application folder\n    ```bash\n    rm -rf /usr/local/file-tagger\n    ```\n\n# Technical details\n\n## Application architecture\n\n![Application architecture schema](doc/architecture.png?raw=true \"Architecture\")\n\nSo we have 6 **C** files that allow us to interact with the **SQLite** database. These are the following files :\n\n- `SupprimerTag.c`\n- `AjouterTag.c`\n- `AfficherTags.c`\n- `ViderTableTags.c`\n- `SupprimerTagIncompatibles.c`\n- `AjouterTagIncompatibles.c`\n\nAnd 2 **Shell** scripts that allow us to override the `ls` and `rm` commands when the `--tag` option is specified (it runs native `ls` and `rm` commands when the option is not\nspecified). These are the files :\n\n- `SupprimerFichier.sh`\n- `AfficherFichier.sh`\n\nThe `configuration.h` file contains the **SQL queries** (definitions) and the **path** to the database file (by default in the current directory where the program will be placed).\nIt is only used for compilation.\n\nThe `configure.sh` file is a helper file used to set permissions and create aliases (also in the _/etc/profile file_).\n\nThe `uninstall.sh` file is a helper file used to remove alias\n\n## Functions\n\nNone of the functions modify the Unix file system itself, you only need to delete the file representing the database (`tag_base.db`) so that everything becomes normal again (no\nmore tagged files, incompatible tags, etc ...).\nOnly the execution of `rm --tag tag` will permanently delete the tagged file and is therefore irreversible.\n\n### Tag a file/directory\n\nIt is done by executing the `addtag` command which will :\n\n1. check if the file or folder passed in parameter exists\n2. create the database if it does not exist\n3. if the argument passed as first parameter is a file :\n    - check if the file is already tagged\n    - if it already is, checks that there is no incompatibility of tags\n    - get the _inode_ of the file and store it with the filename and its tag in the `tags` table into the database\n4. if the argument passed in 2nd parameter is a directory, we go through it recursively, and for each element, we call the function to tag the files (step 3 above is executed for\n   each of the files)\n\nWhen tagging a directory, you can interrupt the process using `ctrl + c`;\n\n### Remove a tag from a file/directory\n\nIt is done by executing the `deltag` command which will :\n\n1. check if the file or folder passed in parameter exists\n2. if the argument passed in 1st parameter is a file :\n    - check if the file is tagged\n    - if it is, deleted it from the `tags` table from the database\n3. if the argument passed as second parameter is a directory, we go through it recursively, and for each element, we call the function to \"untag\" all the files (step 3 above is\n   executed for each files)\n\n### Set 2 tags as incompatible\n\nIt is done by executing the `addincompatibletag` command which will :\n\n1. check that the tags are not already incompatible\n2. add the two incompatible tags in the `incompatible_tags` table into the database (add a record)\n\n### Remove incompatibility between 2 tags\n\nIt is done by executing the `delincompatibletag` command which will :\n\n1. check that the tags are not already incompatible\n2. delete the two incompatible tags from the `incompatible_tags` table from the database (remove the record)\n\n### List all tagged files\n\nIt is done by executing the `delincompatibletag` command which will simply retrieve the content of the `tags` table from the database (user-friendly formatted).\n\n### List all incompatible tags\n\nIt is done by executing the `showincompatibletags` command which will simply retrieve the content of the `incompatible_tags` table from the database (user-friendly formatted).\n\n### Remove all tags on all files\n\nIt is done by executing the `delalltags` command which will simply remove the content of the `tags` table from the database (delete all records).\n\n### List all file tagged with a certain tag\n\nIt is done by executing the `ls –tag [option] tag` command which will :\n\n- select corresponding files (paths) from `tags` table from the database\n- do a `ls` for each of the paths so they are displayed\n- if the `--tag` option is not specified, we just run the native `ls` command with the specified parameters\n\nIt uses the `AfficherFichier.sh` script.\n\n### Remove all files tagged with a certain tag\n\nIt is done by executing the `rm –tag [option] tag` command which will :\n\n- select corresponding files (paths) from `tags` table from the database\n- do a `rm` for each of the paths so they are displayed\n- if the `--tag` option is not specified, we just run the native `rm` command with the specified parameters\n\nIt uses the `SupprimerFichier.sh` script.\n\n## Database\n\nThe **SQLite** database is very light, and contains only 2 tables :\n\n- `tags` (`id`, `inodeFile`, `fileName`, `tagName`);\n- `incompatible_tags` (`id`, `tagName`, `tagName2`);\n\nThe `tag` table therefore contains all the files with their associated tag, and the `incompatibles_tags` table contains all incompatible tag pairs.\n\n# Examples\n\n### Tag a file\n\n![Tag file](doc/tag_file.png?raw=true \"Tag file\")\n\n### Tag a directory (containing a subdirectory)\n\n![Tag directory](doc/tag_directory.png?raw=true \"Tag directory\")\n\n### Interrupting the tag of a directory\n\n![Interrupt directory tag](doc/tag_directory_interrupt.png?raw=true \"Interrupt directory tag\")\n\n### Tag a directory containing already tagged files and some with incompatible tags\n\n![Tag directory with already tagged file](doc/tag_directory_with_errors.png?raw=true \"Tag directory with already tagged file\")\n\n### Set 2 tags as incompatible\n\n![Add incompatible tags](doc/add_incompatible_tags.png?raw=true \"Add incompatible tags\")\n\n### Add already incompatible tags\n\n![Add already incompatible tags](doc/tags_already_incompatible.png?raw=true \"Add already incompatible tags\")\n\n### Remove incompatibility between 2 tags\n\n![Remove tag incompatibility](doc/remove_incompatible_tags.png?raw=true \"Remove tag incompatibility\")\n\n### Remove incompatibility between 2 tags that are not incompatible\n\n![Remove tag incompatibility fail](doc/remove_incompatible_tags_fail.png?raw=true \"Remove tag incompatibility fail\")\n\n### Display all incompatibles tags\n\n![Display all incompatibles tags](doc/show_incompatible_tags.png?raw=true \"Display all incompatibles tags\")\n\n### Remove a tag from a file\n\n![Remove file tag](doc/remove_tag.png?raw=true \"Remove file tag\")\n\n### Display files tagged with a certain tag\n\n![Display files tagged with a certain tag](doc/show_tagged_files_with_tag.png?raw=true \"Display files tagged with a certain tag\")\n\n### Display all tagged files\n\n![Display all tagged files](doc/show_all_tagged_files.png?raw=true \"Display all tagged files\")\n\n### Delete a file tagged with a certain tag\n\n![Delete tagged file](doc/delete_tagged_file.png?raw=true \"Delete tagged file\")\n\n### Delete a file tagged with a certain tag which does not exist\n\n![Delete non existing tagged file](doc/delete_tagged_file_not_exist.png?raw=true \"Delete non existing tagged file\")\n\n### Remove all tags from all files\n\n![Remove all tags](doc/remove_all_tags.png?raw=true \"Remove all tags\")\n\n# License\n\n[General Public License (GPL) v3](https://www.gnu.org/licenses/gpl-3.0.en.html)\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU\nGeneral Public License as published by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\neven the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not,\nsee \u003chttp://www.gnu.org/licenses/\u003e.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyann39%2Funix-file-tagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyann39%2Funix-file-tagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyann39%2Funix-file-tagger/lists"}