LinuxCommandLibrary

tmsu

Tag files and then manage them

TLDR

Tag a specific file with multiple tags

$ tmsu tag [path/to/file.mp3] [music] [big-jazz] [mp3]
copy

Tag multiple files
$ tmsu tag --tags "[music mp3]" [*.mp3]
copy

List tags of specified file(s)
$ tmsu tags [*.mp3]
copy

List files with specified tag(s)
$ tmsu files [big-jazz] [music]
copy

List files with tags matching boolean expression
$ tmsu files "[(year >= 1990 and year <= 2000)] and [grunge]"
copy

Mount tmsu virtual filesystem to an existing directory
$ tmsu mount [path/to/directory]
copy

SYNOPSIS

tmsu [options] command [arguments]

PARAMETERS

--version
    Display version information.

--help
    Display help message.

tag file1 file2 ...
    Tag the specified files with the current tags.

untag file1 file2 ...
    Untag the specified files with the current tags.

view [filespec]
    List tagged files. Optionally, filter by filespec.

locate [tag1 tag2 ...]
    Find files with all the specified tags. If no tags are specified, all tagged files are listed.

not tag1 tag2 ...
    Find files that do not have any of the specified tags.

and tag1 tag2 ...
    Find files that have all the specified tags.

or tag1 tag2 ...
    Find files that have at least one of the specified tags.

cd [tags]
    Change the current directory to a virtual directory based on tags.

echo [tags]
    Echo tagged files paths separated by a newline.

stats
    Show some database statistics.

import
    Import files from current directory based on the directory names as tags.

db-path
    Print the database path.

db-path new_db_path
    Change database path.

sync
    Synchronizes the database with the files. Recalculates paths if files have been renamed.

whereis file1 file2 ...
    Report the location of the given tagged files.

DESCRIPTION

TMSU allows you to tag your files and then access them through multiple tags or filters instead of rigidly bound by the filesystem structure. Instead of moving or symlinking, TMSU maintains a separate metadata database. You can tag a file with multiple tags, search for files based on tags, and perform actions on the search results.

TMSU operates on files using a database that stores the tags and associations. The filesystem and structure of files are not modified and remain untouched. This tagging system allows for flexible organization without altering the physical location of files. TMSU offers features to import, export, and manage the database, making it a versatile tool for personal file organization.

CAVEATS

TMSU doesn't automatically track file modifications. You'll need to re-tag or use the `sync` command if files are moved or renamed outside of TMSU's virtual environment.

TAGGING WORKFLOW

A typical workflow might involve initially tagging files, then using the `locate` command to find files that meet specific tag criteria, and then executing commands on those located files using shell pipes.
For example: `tmsu locate project1 important | xargs vim`

HISTORY

TMSU was created to address the limitations of hierarchical file systems. It allows for tagging files with multiple tags without needing to duplicate or symlink them. It's popularity increased as users found it useful for managing large collections of files across various projects or categories.

SEE ALSO

find(1), locate(1)

Copied to clipboard