Manual
Installation
Copy the python files to a directory and make reftag.py available to your search path. I created a symlink myself:
ln -sf /home/tim/sourceforge/reftag/reftag.py ~/bin/reftag
Then, initialize the database:
reftag -I
A database is now created in $HOME/.reftag/reftag.db. You can use the option -d database to initialize a different database. To use that database, you will need to supply this option to all your reftag commands.
Adding Tags
To add a tag to a file, use:
reftag -a tag1 -a tag2 filename
For example, to add the tags japanese and cooking to the file cookbook.pdf, use:
reftag -a japanese -a cooking cookbook.pdf
The options -a, -r, -R and -e can be used in the same command.
Removing Tags
To remove a tag, use:
reftag -r tag filename
For example to remove the tags vegetarian and politics from the files that match *_cookbook.pdf, use:
reftag -r vegetarian -r politics *_cookbook.pdf
To remove all tags for a file, use:
reftag -R filename
The options -a, -r, -R and -e can be used in the same command.
Editing Tags
To interactively edit tags, use:
reftag -e filename
An editor will be started that shows all the tags, line by line. For example: to edit the tags for the file cookbook.pdf, use:
reftag -e cookbook.pdf
The options -a, -r, -R and -e can be used in the same command.
Listing Tags
To list the tags for a file name, use:
reftag -l filenameor:
reftag filename
For example, to list the tags for all files that match *_cookbook.pdf, use:
reftag -l *_cookbook.pdf
Tags Overview
To see which tags are available, use:
reftag -S
This will give an alphabetical list of all tags and the number of occurences of the tag.
Searching Tags
To search for a tag, use:
reftag -s tag1 -s tag2
This will search for tags that match tag1 AND tag2. For example, to search for all files that are tagged both vegetarian and cooking, use:
reftag -s vegetarian -s cooking
You can use the option -0 to output a list of file names that is suitable for xargs. This allows you to process a batch of files. For example, if you want to rename the tag cooking to recipes, use:
reftag -0 -s cooking | xargs -0 reftag -r cooking -a recipes
Untagged Files
To find files that are not tagged, you will need help from the find command:
find directory -type f -print0 | xargs -0 reftag -u
The -u option prints the file's name if it does not have any tags.