Edit ID3v2 Tags from the Command Line

Use the id3v2 tool to update your music tags either manually on the command line or through shell scripts.

If you ever need to hack the metadata in your MP3 files but wish to have more control over the metadata reading/writing process than you get with common GUI tools, the id3v2 tool can help you. Using this tool, you can dump, change, or remove the ID3 tags from any MP3 file, which makes it perfect for calling from tools like find to dump, change, or remove all the tags in your entire MP3 collection.

The id3v2 tool is a reasonably popular program and should be prepackaged by your Linux distribution of choice. Use your distributions software installation tool to install this program. If for some reason you don’t have this tool prepackaged, download the tarball from http://id3v2.sf.net, compile, and install it according to the included installation instructions.

To list the ID3v2 tag contents of an MP3 file, invoke id3v2 with the -l option:

	$ id2v3–l"Dr Greenthumb.mp3"
	id3v1 tag info for Dr Greenthumb.mp3:
	Title : Dr Greenthumb				Artist: Cypress Hill
	Album : IV					Year: , Genre: Unknown (255)

	Comment: Track: 13
	id3v2 tag info for ../Cypress Hill/IV/13 Dr Greenthumb.mp3:
	TIT2 (Title/songname/content description): Dr Greenthumb
	TALB (Album/Movie/Show title): IV
	TPE1 (Lead performer(s)/Soloist(s)): Cypress Hill
	TRCK (Track number/Position in set): 13

This Cypress Hill track contains both ID3v1 and ID3v2 tags. ID3v1 tags appear at the end of the file and ...

Get Linux Multimedia Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.