tagctl
Tagctl is a command line program which can add or remove tags to files.
The tags can either be in the name or under user.xdg.tags in the extended attributes.
Usage
Usage: tagctl [OPTIONS] [FILES]...
| Option | Description |
|---|---|
-t, --tag <tag> | Tag to add/remove to selected files. %p uses the parent directory name, %y uses the modified year, %m uses modified month, %d uses modified day, and %w uses modified weekday |
-d, --delimiter <delimiter> | Separator for multiple tags (default: ,) |
-i, --input | Accepts input from stdin |
-x, --xattr | Adds/removes tags via xattr under user.xdg.tags |
-r, --remove | Removes tag instead of adding |
-R, --remove_all | Removes all tags |
-v, --verbose | Increases verbosity of output |
-g, --generate_autocomplete <generate_autocomplete> | The shell to generate auto-completion for bash, elvish, fish, zsh |
Examples
Add tag example to current directory using file names:
tagctl -t example "$(ls)"
ls | tagctl --input --tag exampleRemove tag example from current directory using file names:
tagctl -r --tag=example "$(ls)"
ls | tagctl --remove -it exampleAdd tag example to current directory using extended attributes:
tagctl -xt example "$(ls)"
ls | tagctl --xattr --input --tag exampleRemove tag example from current directory using extended attributes:
tagctl -xr --tag=example "$(ls)"
ls | tagctl --xattr --remove -it exampleAdd tag example to two sets of inputs using file names:
find /home/user/Documents | tagctl -it "example" "$(ls)"