TAG(1)

NAME
tag - manage file name tags

SYNOPSIS
tag [OPTION]... tag COMMAND [OPTION]... [ARG]...

DESCRIPTION
Usage: tag [OPTIONS] COMMAND [ARGS]...

  tag - manage file name tags

  File tags:
    - are in the file name matching: {[a-zA-Z0-9-]+}
    - start with '{' and end with '}'
    - consist of letters, numbers and the '-' character

  Examples:
    - myfile{my-tag-1}{my-tag-2}.txt
    - My Title Case File {My-Tag-1}{My-Tag-2}.txt

Options:
  --version Show version information.
  --help Show this message and exit.

Commands:
  add Add tags to files.
  clear Clear tags from files.
  find Find files by tag.
  index Index tagged files.
  list List tags on files.
  remove Remove tags from files.
  rename Rename a tag on files.
  set Set tags on files.
  sort Sort tags on files.
  version Show version information.

COMMANDS

  ADD
Usage: tag add [OPTIONS] TAGS [FILES]...

  Add tags to files.

  TAGS  comma seperated list of tags
  FILES list of files

  Examples:
    - tag add my-tag myfile.txt
    - tag add my-tag-1,my-tag-2 *.txt

Options:
  -v, --verbose Show additional output.
  -d, --debug Make no changes to the file system.
  --help Show this message and exit.

  CLEAR
Usage: tag clear [OPTIONS] [FILES]...

  Clear tags from files.

  FILES list of files

  Examples:
    - tag clear myfile{my-tag}.txt
    - tag clear *.txt

Options:
  -v, --verbose Show additional output.
  -d, --debug Make no changes to the file system.
  --help Show this message and exit.

  FIND
Usage: tag find [OPTIONS] TAG [PATH]

  Find files by tag.

  TAG  tag to find
  PATH path to search (default .)

  Examples:
    - tag find -r my-tag path/to/files/
    - tag find my-tag

Options:
  -a, --all Include hidden files.
  -0, --null End output lines with NULL (\0) instead of newline.
  -r, --recursive Include subdirectories recursively.
  -t, --tree Show output as tree.
  --help Show this message and exit.

  INDEX
Usage: tag index [OPTIONS] PATH OUTPUT

  Index tagged files.

  PATH   path to search
  OUTPUT path to new index

  Examples:
    - tag index my-files my-index
    - tag index -r my-files my-index

Options:
  -a, --all Include hidden files.
  -d, --debug Make no changes to the file system.
  -r, --recursive Include subdirectories recursively.
  -t, --tree Create index with nested tag tree.
  -v, --verbose Show additional output.
  --help Show this message and exit.

  LIST
Usage: tag list [OPTIONS] [PATH]

  List tags on files.

  PATH path to search (default .)

  Examples:
    - tag list -r path/to/files/
    - tag list

Options:
  -a, --all Include hidden files.
  -c, --count Show count of matches.
  -0, --null End output lines with NULL (\0) instead of newline.
  -r, --recursive Include subdirectories recursively.
  --help Show this message and exit.

  REMOVE
Usage: tag remove [OPTIONS] TAGS [FILES]...

  Remove tags from files.

  TAGS  comma seperated list of tags
  FILES list of files

  Examples:
    - tag remove my-tag myfile{my-tag}.txt
    - tag remove my-tag-1,my-tag-2 *.txt

Options:
  -v, --verbose Show additional output.
  -d, --debug Make no changes to the file system.
  --help Show this message and exit.

  RENAME
Usage: tag rename [OPTIONS] OLD_TAG NEW_TAG [FILES]...

  Rename a tag on files.

  OLD_TAG current tag name
  NEW_TAG new tag name
  FILES list of files

  Examples:
    - tag rename my-tag my-new-tag myfile{my-tag}.txt
    - tag rename my-tag my-new-tag *.txt

Options:
  -v, --verbose Show additional output.
  -d, --debug Make no changes to the file system.
  --help Show this message and exit.

  SET
Usage: tag set [OPTIONS] TAGS [FILES]...

  Set tags on files.

  Add and remove tags to ensure each file has the supplied tags and only the
  supplied tags.

  TAGS  comma seperated list of tags
  FILES list of files

  Examples:
    - tag set my-tag myfile{my-tag}.txt
    - tag set my-tag-1,my-tag-2 *.txt

Options:
  -v, --verbose Show additional output.
  -d, --debug Make no changes to the file system.
  --help Show this message and exit.

  SORT
Usage: tag sort [OPTIONS] [FILES]...

  Sort tags on files.

  FILES list of files

  Examples:
    - tag sort myfile{my-tag-2}{my-tag-1}.txt
    - tag sort *.txt

Options:
  -v, --verbose Show additional output.
  -d, --debug Make no changes to the file system.
  --help Show this message and exit.

  VERSION
Usage: tag version [OPTIONS]

  Show version information.

  Examples:
    - tag version

Options:
  --help Show this message and exit.

EXAMPLE
Rename all tags in a directory recursively

  tag find -r0 my-old-tag ~/Documents | xargs -0 tag rename my-old-tag my-new-tag

AUTHOR
Written by Matthew Moulton.

LICENSE
License GPL3: GNU General Public License 3

LINKS

Project: <https://github.com/hewlock/tag>