LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-15-2017, 04:20 PM   #1
snowmagician
Member
 
Registered: Sep 2016
Distribution: Kubuntu
Posts: 62

Rep: Reputation: Disabled
Wink Is there a Linux utility that can do this?


I have a lot of mp3 files named incorrectly. The ID3 tag, ( the information shown when playing within a music player ) is correct but the file name itself is incorrect.

Is there any Linux utility that can fix this?
 
Old 04-15-2017, 04:45 PM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by snowmagician View Post
I have a lot of mp3 files named incorrectly. The ID3 tag, ( the information shown when playing within a music player ) is correct but the file name itself is incorrect.

Is there any Linux utility that can fix this?
A quick google search (the first two hits):

https://www.cyberciti.biz/tips/renam...ll-prompt.html
https://unix.stackexchange.com/quest...script-in-unix

Have fun!
 
Old 04-15-2017, 04:53 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by snowmagician View Post
I have a lot of mp3 files named incorrectly. The ID3 tag, ( the information shown when playing within a music player ) is correct but the file name itself is incorrect.

Is there any Linux utility that can fix this?
Oh my I just write a script that uses this exiftools that uses the METADATA to rename the files to the tags.

would you like to see one of my scripts or write one yourself or ....?

Last edited by BW-userx; 04-15-2017 at 05:06 PM.
 
Old 04-15-2017, 04:59 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Oh heck, I will just punch one out for you.

read them links provided in that other post to hopefully learn what is really going on with this script.
Code:
#!/bin/bash

working_dir=

script_dir=

while read FILENAME 
do

f=$FILENAME
path=${f%/*}
xfile=${f##*/}
title=${xfile%.*}
ext=${xfile##*.}

TITLE="`exiftool  -Title  "$FILENAME" -p '$Title'`"

newFileName="$TITLE"."mp3" 

mv -v "$FILENAME" "$path/$newFileName"

done < <(find "$working_dir" -type f -name "*.mp3")
that should do it. test it first if you decide to use it.

Just need to have exiftools installed.

Last edited by BW-userx; 04-15-2017 at 05:11 PM.
 
Old 04-15-2017, 05:09 PM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
If you want a GUI solution, Puddletag is nice. You can use it to bulk set filenames based on the track metadata.
 
Old 04-15-2017, 05:17 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by hydrurga View Post
If you want a GUI solution, Puddletag is nice. You can use it to bulk set filenames based on the track metadata.
Oh yeah Puddletag does that?
and I only used it for checking my tags and bulk setting of tags.

Never looked at it that hard I guess. always enjoying a bash script I suppose.
 
Old 04-15-2017, 05:26 PM   #7
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by BW-userx View Post
Oh yeah Puddletag does that?
and I only used it for checking my tags and bulk setting of tags.

Never looked at it that hard I guess. always enjoying a bash script I suppose.
Yup. Convert: Tag->File.

I always take the easiest way out - I don't have the bash script-fu like you.
 
Old 04-15-2017, 05:28 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by hydrurga View Post
Yup. Convert: Tag->File.

I always take the easiest way out - I don't have the bash script-fu like you.
hehe no fu 4 u more 4 me?
 
Old 04-16-2017, 07:47 AM   #9
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
KID3 is another good GUI tool for this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux DD utility Gmorrison50 Linux - Newbie 3 02-07-2013 07:40 AM
Utility for Disk Usage / Treesize utility teknoratti Linux - Software 1 06-08-2011 02:53 AM
Linux Utility s0n|k Linux - Newbie 4 02-26-2006 02:08 PM
is there a linux utility.... linuxnube Linux - Software 4 01-22-2004 01:45 PM
Help with a linux utility Ripper951 Linux - General 6 01-12-2003 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration