TAGUTIL(1)
π NAME π
okay so bestie, this is TAGUTIL(1) from the General Commands Manual β and it's literally tagutil, the icon who edits and displays music files tags. π
No cap, tagutil can support most music file formats (including FLAC, Ogg/Vorbis and MP3) and multiple output formats including YAML (the default), so it stays both human and script friendly. periodt.
πΈ SYNOPSIS πΈ
tagutil [-hpYN] [-F format] [action ...] file ...
β¨ DESCRIPTION β¨
tagutil displays and modifies tags stored in music files. It can support most music file formats (including FLAC, Ogg/Vorbis and MP3) and multiple output formats including YAML (the default) to be both human and script friendly.
π OPTIONS π
-hβ Showtagutilhelp displaying the version,OPTIONS,ACTIONS, outputFORMATS, andBACKENDS.-pβ Create intermediate directories as required on rename. Useful when the rename pattern expands to a path in a directory that does not exist. It is ignored when there is norenameaction. This option is inspired by the-poption frommkdir(1).-Yβ answer βyesβ to all questions.-Nβ answer βnoβ to all questions.-F formatβ Useformatfor tags output and parsing. The list of supported values forformatcan be seen by invokingtagutil -h. See also theFORMATSsection.
π ACTIONS π
Each action is executed in order for each file. If no action is given, print will be executed.
printβ Display the list of tags (default). See alsoFORMATS.backendβ Display the backend used. See alsoBACKENDS.clear:TAGNAMEβ Erase allTAGNAME. IfTAGNAMEis empty, all tags are erased.add:TAGNAME=valueβ Add a new tag at the end of the tag list.set:TAGNAME=valueβ Replace the first instance ofTAGNAMEand clear the following. Equivalent toadd:TAGNAME=valueif there is noTAGNAMEin the tag list.editβ ExecuteEDITORto prompt for tag editing in a temporary file, and then load the temporary file. The load action is cancelled if the editing process exited with a non-zero status code or if the temporary file was left unmodified.load:fmtfileβ Parse the given file atfmtfileand load the tags into the music file.fmtfilehas to honor the given format (or the default) in order to be successfully parsed. Iffmtfileis empty or-, the standard input is used.rename:patternβ Rename files according to the given pattern. The pattern can containTAGNAMEkeywords which will be expanded with their value.tagutilwill ask for confirmation to avoid accidental renames (see-Yand-Noptions).
The pattern language uses % for TAGNAME expansion. A literal % can be escaped with a backslash: \%
%keyβ is replaced by the value of the firstkeytag found in the tag list. This syntax is used whenkeycontains only alphanumeric character(s).%{key}β is replaced by the value of the firstkeytag found in the tag list. Any character can be enclosed into the delimiting braces (to enclose the}character, escape it with a backslash).
NOTE: If the pattern (or an expanded tag) contains a/character,tagutilwill check the destination directory. If the destination directory exists,tagutilwill rename the file and its parent directory will change. If the destination directory does not exist and-pwas given,tagutilwill try to create the intermediate directories before the rename. If the destination directory does not exist and-pwas not given,tagutilwill display an error message and exit.
π§ BACKENDS π§
tagutil is designed in a modular way, making it very easy to add support for any file format. This section describes each music file format supported, but the complete list supported by the installed version should be checked with tagutil -h.
libFLAC
Free Lossless Audio Codec (FLAC) files format (https://xiph.org/flac/). The FLAC format uses Vorbis Comments to store tags. This means that, like Ogg/Vorbis, FLAC supports an ordered, unlimited set of tags allowing duplicate keys.
libvorbis
Ogg/Vorbis files format (http://www.vorbis.com/). Ogg/Vorbis uses Vorbis Comments to store tags and supports an ordered, unlimited set of tags allowing duplicate keys.
TagLib
TagLib is a library for reading and editing the meta-data of several popular audio formats (http://taglib.github.io/). This backend only supports a limited set of tags: title, artist, album, comment, genre, year and track.
ID3V1
A simple ID3v1.1 backend (built-in). ID3v1.0 and ID3v1.1 are only used by old MP3 files and have been superseded by ID3v2 more than ten years ago. Its simplicity makes it a good example for backend implementation and it is disabled by default.
π OUTPUT FORMATS π
tagutil is designed in a modular way, making it very easy to add support for any output format. This section describes each implemented format, but the complete list supported by the installed version should be checked with tagutil -h.
yml
YAML is the default format because it is both human friendly for edit and print and has good support in popular scripting languages. It is implemented using libyaml (http://pyyaml.org/wiki/LibYAML), which can produce very detailed error messages (useful to debug scripts).
json
JSON is intended to be used for scripting as an alternative to YAML.
π ENVIRONMENT π
The LC_ALL, EDITOR and TMPDIR environment variables affect the execution of tagutil.
LC_ALLβ Note that both standard YAML and JSON require UTF-8 and so willtagutilwhen using one of these formats. Command line actions likeaddwill honorLC_ALLby encoding theTAGNAMEandvalueaction arguments in UTF-8 if needed.EDITORβ required when theeditaction is invoked.TMPDIRβ used to store the temporary file used by theeditaction.
β EXIT STATUS β
The tagutil utility exits 0 on success, and >0 if an error occurs.
π₯ EXAMPLES π₯
Print the tags of file.flac:
% tagutil file.flac
Set the title "foo" to file.ogg:
% tagutil set:title=foo file.ogg
Interactively edit the file.flac's tags:
% tagutil edit file.flac
Rename file.flac using its artist, album, track number and title tags:
% tagutil rename:"%artist - %album - [%tracknumber] - %title" file.flac
Clear all tags and then add an artist and album tag.
% tagutil clear: add:artist="Pink Floyd" add:album="Meddle" *.flac
Switch all tag keys track to trackname
% tagutil file.flac | sed -e 's/^- track:/- tracknumber:/' | tagutil load: file.flac
A Ruby script that trims every tag value:
#!/usr/bin/env ruby
require 'yaml'
require 'open3'
ARGV.each do |arg|
Open3.popen3('tagutil', arg) do |_, pstdout, pstderr|
$s = pstdout.read
$e = pstderr.read
end
yaml = YAML.load($s)
if not yaml
STDERR.puts($e)
else
stripped = Array.new
yaml.each do |hash|
hash.each do |key, val|
newval = if val.respond_to?(:strip) then val.to_s.strip else val end
stripped << { key => newval }
end
end
Open3.popen3('tagutil', 'load:-', arg) do |pstdin, pstdout, pstderr|
pstdin << stripped.to_yaml
pstdin.close
STDERR.puts($e) unless ($e = pstderr.read).strip.empty?
end
end
end
π AUTHORS π
Alexandre Perrin <alex@kaworu.ch>Baptiste Daroussin <bapt@FreeBSD.org>
π BUGS π
- All current implemented output formats will force UTF-8 for both output and parsing.
- When the TagLib backend is used with MP3 files it will interpret integer values for the
genretag as index for the ID3 Tag Genre ID (extended) list. Although this is intended as a feature, it makes the interface inconsistent with other backends.
xoxo, your Debian bestie π β this page is from Debian, dated December 18, 2015, and it's literally TAGUTIL(1). periodt. π
π¦ where this page comes from
- alpine 3.24: tagutil-doc 3.1-r3 Β· BSD-2-Clause
- nixos 26.05: tagutil 3.1-unstable-2025-06-16
- nixpkgs unstable: tagutil 3.1-unstable-2025-06-16
- Copyright (c) 2008-2013 Alexandre Perrin <alex@kaworu.ch>. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms