LLTAG(1)
๐ LLTAG(1) โ the lltag manual, bestie edition ๐
General Commands Manual ยท part 1 of 3, so don't go anywhere ๐ซถ
โจ NAME โจ
lltag โ tag and rename mp3/ogg/flac music files automagically ๐
๐ธ SYNOPSIS ๐ธ
lltag [-C] [-E] [-F <format>] [-G] [-p] [-a <artist>] [-t <title>] [-A
<album>] [-n <number>] [-g <genre>] [-d <date>] [-c <comment>] [--tag
<TAG=value>] [--spaces] [--maj] [--sep <s1|s2|...>] [--regexp <regexp>]
[--mp3/--ogg/--flac] [--type <type>] [--clear] [--append] [--no-tagging]
[--preserve-time] [--rename <format>] [--rename-ext] [--rename-min]
[--rename-sep <sep>] [--rename-slash <char>] [--rename-regexp <regexp>]
[--dry-run] [--yes] [--ask] [--cddb-query <query>] [--cddb-server
<server[:port]>] [-R] [-v] [-q] [--config <file>] [--gencfg <file>] [-S]
[--show-tags <tags>] [-L] [-V] [-h] files...
okay yes it's a lot of brackets, it's giving "I contain multitudes" and honestly? slay ๐
๐ฆ DESCRIPTION ๐ฆ
lltag is a command-line tool that automagically sets the tags on your MP3, OGG or FLAC files. And there are like, several whole ways to get the tags that are gonna get set:
๐ Parsing the filename
lltag can either parse the filename using its own internal database of commonly-used formats โ that's the default behavior, or what you get when -G is passed โ or it can use some formats that you provide, which happens when -F is passed.
๐ Requesting from CDDB
lltag can hit up an online CDDB database to pull tags from a track of a CD. That's the -C situation.
๐ Explicitly setting values
lltag hands you a whole set of command-line options so you can manually set various tags yourself. Very main character of you.
๐ Manually editing values
lltag also gives you an interactive interface to edit existing values, or literally any value that came out of the strategies above.
So every single time a new audio file gets processed, lltag starts by trying to obtain new tags, and exactly what it does depends on the behavior options you gave it.
Here's the order of operations, and it matters, so pay attention bestie:
- First, if a preferred parser was selected before, it gets used to try to parse the new filename.
- Then, if editing is enabled (
-E), you get to modify existing tag values. - Then, if CDDB is enabled (
-C), you'll be asked whether to request tags from the online CDDB database. - Then, if you provided any parsing format (
-F), or if guessing is enabled (-G),lltagwill attempt to parse the filename.
ngl this one's important: if you don't choose any behavior at all on the command line โ including no renaming option โ then parsing with the internal format database gets used by default, as if -G had been passed. ๐ซถ
The moment one of those strategies succeeds, lltag jumps to the main menu, where you can either accept the new tags or pick another behavior. (Scroll to MAIN MENU in INTERACTIVE MENUS below for the deets, iykyk.) And if --yes was passed, or if automatic mode was already turned on in the menu, it'll just go ahead and do the tagging โ plus renaming if you asked for it โ then move on to the next file. Periodt.
The new tags that your chosen strategy returns get appended with the explicit values you gave via -a, -t, -A, -g, -n, -d, -c or --tag. Then those combined tags will either:
- replace the existing tags in the target file (this is the default),
- clear and replace them (
--clear), or - append to them (
--append).
Once the tags are known, a backend program or library is used to apply them to the audio file โ unless --no-tagging is passed, obviously. And here's who does the work:
- the
MP3::TagPerl module ormp3infohandles tagging MP3 files ๐ต vorbiscommenthandles OGG files ๐metaflachandles FLAC files โจ
And at the very end, when you call it with --rename, the target file also gets renamed according to a format you provide, filled in with the tag values. iconic, honestly ๐
โจ more coming in part 2, don't touch that dial โจ
โจ OPTIONS โจ
okay bestie, this is the big one โ every single flag lltag will take, what it does, and which config-file option it's lowkey twinning with. no skips, we're doing all of them ๐
-A,--ALBUM <album>โ adds a value for theALBUMtag ๐-a,--ARTIST <artist>โ adds a value for theARTISTtag ๐ธ--appendโ forces appending of ogg/flac tags (instead of replacing existing tags). the config file option isappend_tags. โ ๏ธ and here's the tea: since mp3 files may only get one tag of each type, appending does literally nothing for them โ the first occurrence only is stored. no cap.--askโ always ask confirmation to the user before using a user-specified parser. by default, all actions require confirmation, except when a matching user-specified format is found. the config file option isask. see PARSING MENU in INTERACTIVE MENUS below for the deets ๐-C,--cddbโ tries to find tags in the CDDB online database before trying to parse filenames. the queries are sent using the HTTP interface, which means a HTTP proxy might be used when required. the config file option iscddb๐--cddb-query <keywords>--cddb-query <cat>/<id>โ automatically searches for a CD matching<keywords>, or matching category<cat>and id<id>, as if the user passed--cddband typed the query in interactively in the module. two flavors, one icon ๐ซถ--cddb-server <server[:port]>โ changes the CDDB server, and eventually its port too. the default iswww.freedb.org:80. the corresponding config file options arecddb_server_nameandcddb_server_port. if a HTTP proxy is required to access the internet, the environment variableHTTP_PROXYmay be used (set it to something like"http://my.proxy.com") ๐-c,--COMMENT <comment>โ adds a value for theCOMMENTtag ๐ฌ--clearโ forces clearing of all tags before tagging (instead of replacing existing tags). the config file option isclear_tags. fresh start energy โจ--config <file>โ parses an additional configuration file. see CONFIGURATION FILES below for details.-d,--DATE <date>โ adds a value for theDATEtag. ๐ heads up tho: the ID3 date tag may only store 4 characters (for a year), so don't get too ambitious.--dry-runโ does not really tag files, just shows what would have been done. the config file option isdry_run. pretend-tagging, no consequences, love that for us ๐-E,--editโ edits tags immediately โ๏ธ-F,--format <format>โ adds the specified format string to the list of user-supplied formats. the config file option isformat. might be used several times to try different formats. see FORMAT below for details ๐--flacโ tags all files as FLAC files, using the FLAC backend (based onmetaflac). the config file option istype.-G,--guessโ guesses format using the internal database if no user-specified format worked (this is the default behavior, bestie). the config file option isguess๐ฎ-g,--GENRE <genre>โ adds a value for theGENREtag. while some file types accept any string as a genre, some others (especially ID3v1 tags in MP3 files) require the string to match within a list of specified genres. so like, read the room ๐ต--gencfg <file>โ generates a configuration file. see CONFIGURATION FILES below for details.-h,--helpโ prints a usage message and exits. the classic ๐ซถ-L,--listโ lists internal formats ๐--majโ upcases the first letter of each word in tags. the config file option ismaj. it's giving Title Case ๐--mp3โ tags all files as MP3 files, using the MP3 backend (based on eithermp3infoorMP3::Tag). the config file option istype.--mp3v2,--id3v2โ enables the experimental MP3 ID3v2-aware backend (based onMP3::Tag) instead of the old ID3v1-only backend. experimental = proceed with cute caution ๐งช--mp3read=[1][2]โ configures how the MP3v2 backend reads and merges ID3v1 and v2 tags. by default, v1 are appended to v2 (21). if set to1, only v1 are read. if set to2, only v2 are read. if set to12, v2 are appended to v1. note that merging/appending takes care of removing duplicates, so no dupes in the group chat ๐ซ-n,--NUMBER <number>โ adds a value for theNUMBERtag ๐ข--no-taggingโ does not actually tag files. this might be used to rename files without tagging. the config file option isno_tagging.-T,--preserve-timeโ preserves file modification time during tagging. the config file option ispreserve_time. respect the timestamps ๐ฐ๏ธ--oggโ tags all files as OGG files, using the OGG backend (based onvorbiscomment). the config file option istype.-p,--no-pathโ does not consider the path of files when matching. the config file option isno_path๐ฃ๏ธ-q,--quietโ decreases message verbosity. the config file option isverbose, which indicates the verbose level. see-vfor details about the existing verbosity levels. shhh ๐คซ-R,--recursiveโ recursively searches for files in subdirectories that are given on the command line. the config file option isrecursive. down the rabbit hole we go ๐--regexp <[tag,tag:]s/from/to/>โ replacesfromwithtoin tags before tagging. the config file option isregexp. if several tags (comma-separated) prefix the regexp, replacement is only applied to the corresponding fields. this option might be used multiple times to specify multiple replacing ๐--rename <format>โ after tagging, renames the file according to the format. the config file option isrename_format. the format is filled using the first occurrence of each tag that was used to tag the file right before. it means that an old existing tag may be used if no new one replaced it and--clearwas not passed. ๐
by default, confirmation is asked before tagging. see RENAMING MENU in INTERACTIVE MENUS below for details.
--rename-extโ assumes that the file extension is provided by the rename format instead of automatically adding the extension corresponding to the file type. the config file option isrename_ext.--rename-minโ lowcases all tags before renaming. the config file option isrename_min. lowercase era ๐--rename-regexp <[tag,tag:]s/from/to/>โ replacesfromwithtoin tags before renaming. if several tags (comma-separated) prefix the regexp, replacement is only applied to the corresponding fields. this option might be used multiple times to specify multiple replacing. the config file option isrename_regexp.--rename-sep <sep>โ replaces spaces withsepwhen renaming. the config file option isrename_sep. see--rename-regexpfor a more general replace feature.--rename-slash <char>โ replaces slashes withcharwhen renaming. the config file option isrename_slash. see--rename-regexpfor a more general replace feature. slashes are not the vibe in filenames ๐ซ-Sโ instead of tagging, lltag shows the tags that are currently set in files. see--show-tagsto show only some tags ๐--sep <string|string>โ replaces the specified characters or strings with a space in tags. the config file option issep. they have to be|-separated. see--regexpfor a more general replace feature.--show-tags <tag1,tag2,...>โ instead of tagging, lltag shows tags that are currently set in files. the argument is a comma separated list of tag types (artist,title,album,number,genre,date,commentorall). see also-Sto show all tags ๐ท๏ธ--spacesโ allows multiple or no space instead of only one when matching. also allows spaces limiting path elements. the config file option isspaces. see also INTERNAL FORMATS to get the detailed impact of this option.-t,--TITLE <title>โ adds a value for theTITLEtag โจ--tag <TAG=value>โ adds an explicit tag value. the config file option istag. might be used several times, even for the same tag. when setting a common tag, it is similar to using-a,-A,-t,-n,-g,-dor-c. note that mp3 tags do not support whateverTAG๐ญ--type <type>โ tags all files as<type>files. the config file option istype.-v,--verboseโ increases message verbosity. the config file option isverbose, which indicates the verbose level. ๐ข
the default verbosity level is 0 to show only important messages. other possible values are 1 to show usage information when a menu is displayed for the first time, and 2 to always show usage information before a menu appears.
see also -q.
-V,--versionโ shows the version ๐ท๏ธ--yesโ always accepts tagging without asking the user. the config file option isyes. by default, user-specified format matching is accepted while guess format matching is asked for confirmation. it also always accepts renaming without asking the user. consent mode: off, chaos mode: on ๐
๐ INTERACTIVE MENUS ๐
So when you're not running with --yes, bestie, you have to tell lltag what to do. It's not gonna guess your whole life for you. Files get processed one after the other, and each one goes through this lil journey:
- If the preferred parser exists, it tries to apply it. Go parser go โจ
- If that failed, and if
--cddbwas passed, it tries a CDDB query. - If that failed too, it tries the user-provided formats, if any were given.
- Still failed? Then if no user-format was passed, or if
-Gwas passed, it tries the internal formats. - Then boom โ we have a list of tags to apply, and we may apply them, edit them, or go back to a CDDB query / try parsing the filename again.
- Then, if
--renamewas passed, the file gets renamed. Glow up ๐
Okay but real talk: when you hit Ctrl-d at the beginning of an empty line (that's EOF), the general behavior is to cancel the current operation without leaving. So you can bail on the thing you're doing without yeeting the whole program. Iconic.
Now let's describe all the interactive menus in detail, because there are a lot of them and they all have lore. ๐ง
๐ MAIN MENU ๐
Once some tags have been obtained by either CDDB, parsing, or the explicit values you gave on the command line, the main menu opens so you can either change the tags or just apply them:
yโ Yes, use these tags (default).aโ Always yes, stop asking for a confirmation.Pโ Try to parse the file, see PARSING MENU.Cโ Query CDDB, see CDDB MENUS.Eโ Edit values, see EDITING MENU.Dโ Only use explicit values, forget about CDDB or parsed tags.Zโ Reset to no tag values at all.Rโ Revert to existing tag values from the current file.Oโ Display existing tag values in the current file.nโ Do not tag this file, jump to renaming (or to the next file if renaming is disabled).q(or EOF) โ Skip this file.Qโ Quit without tagging anything anymore. Bye bestie ๐ญ
๐ฟ CDDB MENUS ๐ฟ
When the CDDB opens for the very first time, you must enter a query to choose a CD in the online database. No skipping, it's the rules.
- space-separated keywords โ CDDB query for CD matching the keywords. It searches in all CD categories within the fields artist OR album. So like, it's searching everywhere, periodt.
q(or EOF) โ Quit CDDB query, see MAIN MENU.
Once keywords have been passed as a query to CDDB, a list of matching CD titles gets displayed. Then you gotta choose one:
- index โ Choose a CD in the current keywords query results list.
Vโ View the list of CD matching the keywords.kโ Start again CDDB query with different keywords.q(or EOF) โ Quit CDDB query, see MAIN MENU.
Once a CD has been chosen, you need to choose a track:
- index โ Choose a track of the current CD.
- index
aโ Choose a track and do not ask for confirmation anymore. aโ Use default track and do not ask for confirmation anymore.Eโ Edit current CD common tags, see EDITING MENU.vโ View the list of CD matching the keywords.cโ Change the CD chosen in keywords query results list.kโ Start again CDDB query with different keywords.q(or EOF) โ Quit CDDB query, see MAIN MENU.
โจ Pro tip from the manpage itself: entering the CDDB menus again will go back to the previous CD instead of asking you to query again, so that an entire CD may be tagged easily. That's genuinely so convenient, we love efficiency here ๐ซถ
๐ PARSING MENU ๐
When --ask is passed, or when it's guessing, each matching leads to a confirmation message before tagging. Here's what you can do:
yโ Tag current file with current format. This is the default.uโ Tag current file with current format. Then use current format for all remaining matching files. When a non-matching file is reached, stop using this preferred format.aโ Tag current file with current format. Then, never asking for a confirmation anymore.nโ Don't tag current file with this format. Try the next matching format on the current file.pโ When matching is done through combination of a path parser and a basename parser, keep the basename parser and try the next path parser on the current file.q(or EOF) โ Stop trying to parse this file.
โ๏ธ EDITING MENU โ๏ธ
You can edit tags, either before tagging a file, or before choosing a track in a CD obtained by CDDB. The current value of all regular fields is shown, and you may modify it by entering another value, delete it by entering <DELETE>, or clear it.
The behavior depends on the installed readline library, and honestly that library is the main character of this whole section:
- If it's smart, the current value may be edited inline and a history is available. So bougie โจ
- If it's not smart, pressing
<enter>will keep the current value whileCLEARwill empty it. - EOF will cancel the editing of this single value.
Each field may be selected for edition by pressing its corresponding letter in the format (see FORMAT). And since there might be some non-standard tag names, it's also possible to enter tag FOO to modify tag FOO. Very flexible of you, honestly.
Editing ends by tagging (if E is pressed) or canceling and returning to the confirmation menu (if C is pressed).
The other options are:
Vโ View the current values of tags.yโ End edition, save changes, and return to previous menu.q(or EOF) โ Cancel edition, forget about changes, and return to previous menu.
๐ RENAMING MENU ๐
By default, before renaming, a confirmation is asked from the user. You may bypass it by passing --yes on the command line. (Living dangerously, I respect it.)
If the rename format uses a field that is not defined, a warning is shown and confirmation is always asked. No shortcuts, bestie.
Available behaviors when renaming:
yโ Rename current file with current new filename. This is the default.aโ Rename current file with current new filename. Then, never asking for a renaming confirmation anymore.eโ Edit current new filename before renaming. The behavior depends on the installed readline library. If it's smart, the current value may be edited inline and a history is available.q(or EOF) โ Don't rename current file.hโ Show help about confirmation.
๐ FORMAT ๐
User-specified formats must be a string composed of any characters and the following special codes. Think of these as the little spell-codes of the tag world ๐ช:
%ato match the author.%Ato match the album.%gto match the genre.%nto match the track number.%tto match the title.%dto match the date.%cto match the comment.%ito match anything and ignore it.%%to match%.
Additionally, while renaming, these extra codes are available:
%Fis replaced by the original basename of the file.%Eis replaced by the original extension of the file.%Pis replaced by the original path of the file.
๐ INTERNAL FORMATS ๐
The internal format database is usually stored in /etc/lltag/formats. The user may override this file by defining a $HOME/.lltag/formats. If this file exists, the system-wide one is ignored โ user wins, always ๐
See the manpage of lltag_formats or /etc/lltag/formats for details.
โ๏ธ CONFIGURATION FILES โ๏ธ
lltag reads some configuration files before parsing command line options. Order matters, periodt.
The system-wide configuration file is defined in /etc/lltag/config if it exists.
It also reads $HOME/.lltag/config if it exists.
The user may also add another configurable file with --config.
lltag may also generate a configuration with --gencfg. Slay, it writes its own config ๐
See the manpage of lltag_config or the example of config file provided in the documentation for details.
๐ FILES ๐
/etc/lltag/formatsโ System-wide internal format database. See INTERNAL FORMATS for details.$HOME/.lltag/formatsโ User internal format database. If it exists, the system-wide one is ignored.$HOME/.lltag/edit_historyโ History of last entered values in the edition mode if the Readline library supports this feature./etc/lltag/configโ System-wide configuration file, if it exists. See CONFIGURATION FILES for details.$HOME/.lltag/configโ User configuration file.
๐ซ EXAMPLES ๐ซ
Show all tags for each OGG files in the current directory:
lltag -S *.ogg
Show only a selected list of tags for all files in all subdirectories:
lltag --show-tags artist,album,title,number -R .
Set an arbitrary tag in a file (only works with OGG vorbis or FLAC files):
lltag --tag foo=nil foo.ogg
Delete the foo tag from a file:
lltag --tag foo= bar.ogg
Set the ALBUM, ARTIST and GENRE tag values of the MP3 files in the current directory:
lltag --ARTIST "Queen" --ALBUM "Innunendo" --GENRE "rock"
--COMMENT="very cool" *.mp3
Rename a file by assembling its current NUMBER, ARTIST and TITLE tag values:
lltag --no-tagging --rename "%n - %a - %t" foobar.ogg
Clear all tags in all FLAC files:
lltag --clear *.flac
๐ SEE ALSO ๐
The howto.html file provided within the documentation. Go read it, iykyk ๐
๐ AUTHOR ๐
Brice Goglin
And that's a wrap on LLTAG(1), bestie ๐ซถ This page came from the lltag source and its date stamp says NOVEMBER 2006 โ vintage but still serving, fr fr. Go tag something and make it iconic โจ๐
๐ฆ where this page comes from
- debian bookworm: lltag 0.14.6-1.1
- debian trixie: lltag 0.14.6-1.1
- ubuntu jammy: lltag 0.14.6-1.1
- ubuntu noble: lltag 0.14.6-1.1
- ubuntu resolute: lltag 0.14.6-2 ยท GPL-2.0-or-later
- ubuntu stonking: lltag 0.14.6-2 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms