-
Senior Member
registered user
do something with all files in all subdirs
hi,
I want to remove the idv2 tags from my musepack files, which i have accidentally added. but my files are put in several directory's (in fact, every band+every album in his own dir). I downloaded a command-line tool, to remove the idv2 tag, with a command like
Code:
idv2edit -remove <filename>
but... how to do this for all files in all dirs, in one command??? I guess it is possible, but how... I dont know. (actually I dont know much 'bout the commandline, and i cant find it in manuals, how-to's etc)
-
Senior Member
registered user
If your 'idv2edit' command can only act on one file at a time, try:
Code:
for $file in $( find /startdir -name '*.mp3' )
do
idv2edit -remove $file
done
If it can handle a list of files, there's a slightly simpler form:
Code:
$ find /startdir -name '*.mp3' | xargs idv2edit -remove
I suggest you first susbtitue a plain 'echo' to your command, so you'll
see exactly which files will be touched.
-
Senior Member
registered user
hi...
I tried your commands, and, after some playing with man etc I was still unable to use them. find didnt return any mp3z, but I found out that if I modified the command into: find -name '*/*/*.mp3', it did return the filenames. but that didnt seem to change anything, so I guess id3v2edit doesnt accept more files.
so, I tried to copy-paste your first idea:
(the 'find' part works, at least, it returns alot of mpc-files)
for $file in $( find -name '*.mpc' ) ; do id3v2 -d $file ; done
but this only returned "bash: `$file': not a valid identifier". and I dont even know what that means... I understand what the the intention is of the piece of code, but I cant solve this problem. 
tried read the man for bash, it told me that it should be allright, as far as I understood it.
-
Senior Member
registered user
(the first command replies: xargs: unmatched single quote)
-
Senior Member
registered user

Originally Posted by
Superstoned
for $file in $( find -name '*.mpc' ) ....
Sorry, that should be: "for file in..." (no dollar here, but one's needed when dereferencing)
-
Senior Member
registered user
aaah, tnx, I'm trying it now...
-
Senior Member
registered user
and it doesnt seem to work, although it comes closer. but now i get errors like
fopen: ./Bands/klassiek/09: id3v2: No such file or directory
fopen: -: id3v2: No such file or directory
fopen: The: id3v2: No such file or directory
fopen: Blue: id3v2: No such file or directory
fopen: Danube.mpc: id3v2: No such file or directory
looks like the directory's (and long filenames) are the problem?!?
command was:
for file in $( find -name '*.mpc' ) ; do id3v2 -d $file ; done
I tried to put the $file this way: '$file'. but that returned
fopen: $file: id3v2: No such file or directory
and im goin' now, for some days, so - ill check back later (next week). tnx for all the help and advice!
-
Senior Member
registered user

Originally Posted by
Superstoned
looks like the directory's (and long filenames) are the problem?!?
Indeed embedded spaces seem to interfere; try
Cheers,
bald.
-
Senior Member
registered user
--Here's a couple of more things you can try adapting to work with the ' find ' command: (NOTE: Case-conversion commands generally don't work on FAT32 - it thinks it's the same exact filename. Copy the files to a Linux filesystem like ext2 or reiserfs if you want them case-translated.)
# cvt all fnames to locase:
Code:
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
# cvt spaces to dashes
Code:
for i in *.mp3; do mv "$i" `echo $i | tr ' ' '-'`; done
# cvt to std extensions - another way
Code:
for i in *.MP3; do mv "$i" "`basename "$i" .MP3`.mp3"; done

Originally Posted by
Superstoned
and it doesnt seem to work, although it comes closer. but now i get errors like
fopen: ./Bands/klassiek/09: id3v2: No such file or directory
fopen: -: id3v2: No such file or directory
fopen: The: id3v2: No such file or directory
fopen: Blue: id3v2: No such file or directory
fopen: Danube.mpc: id3v2: No such file or directory
looks like the directory's (and long filenames) are the problem?!?
command was:
for file in $( find -name '*.mpc' ) ; do id3v2 -d $file ; done
I tried to put the $file this way: '$file'. but that returned
fopen: $file: id3v2: No such file or directory
and im goin' now, for some days, so - ill check back later (next week). tnx for all the help and advice!
-
Senior Member
registered user
hmmm, sorry i didnt reply earlier. thought I posted, but I think I forgot to press submit...
I've been on a festival for some days
got sick
so im back home...
anyway, I still haven't made it.
when I give the following line:
for file in $( find -name '*.mpc' ) ; do id3v2 -d $file ; done
I get:
(...)
fopen: ./Overig/Cypress: id3v2: No such file or directory
fopen: Hill/III: id3v2: No such file or directory
fopen: (Temples: id3v2: No such file or directory
fopen: of: id3v2: No such file or directory
fopen: Boom)/Cypress: id3v2: No such file or directory
fopen: Hill: id3v2: No such file or directory
fopen: -: id3v2: No such file or directory
fopen: 13: id3v2: No such file or directory
fopen: -: id3v2: No such file or directory
fopen: Strictly: id3v2: No such file or directory
fopen: Hip: id3v2: No such file or directory
fopen: Hop.mpc: id3v2: No such file or directory
(...)
there seems to be a problem with the spaces somewhere?
I tried:
for file in $( find -name '*.mpc' ) ; do id3v2 -d '$file' ; done
but I got:
(...)
fopen: $file: id3v2: No such file or directory
fopen: $file: id3v2: No such file or directory
fopen: $file: id3v2: No such file or directory
fopen: $file: id3v2: No such file or directory
fopen: $file: id3v2: No such file or directory
(...)
Similar Threads
-
By sunpascal in forum The Lounge
Replies: 5
Last Post: 01-13-2010, 07:06 AM
-
By jehan60188 in forum MS Windows & New to Linux
Replies: 2
Last Post: 01-23-2005, 11:57 AM
-
By pc3 in forum General Support
Replies: 3
Last Post: 06-27-2004, 01:18 PM
-
By bikerman in forum General Support
Replies: 1
Last Post: 04-15-2004, 12:22 AM
-
By Akurei in forum General Support
Replies: 1
Last Post: 03-20-2004, 05:48 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Acer Aspire 14" AI Copilot+PC Laptop Core Ultra 5 226V Gen 4 ARC 16GB 1TB Refurb
$482.02

Dell Latitude 14" Laptop Computer Intel i5 Up To 32GB RAM 1TB SSD Windows 11 Pro
$372.48

Dell ST91000640SS 1TB 2.5" 6Gb/s 64MB 7.2K RPM SAS Hard Drive Dell P/N: 0VXTPX
$16.99

Apple MacBook Pro 16in 2026 M5 Pro 24GB RAM 1TB SSD 20-Core GPU Black
$2300.00

Acer Predator Helios Neo 16S AI 16" i9 275HX 2S RTX 5070 Ti 32GB 1TB SSD Refurb
$1775.56

SAMSUNG T7 Portable SSD 1TB Indigo Blue USB 3.2 Gen2 External MU-PC1T0H/AM
$159.99

Acer Aspire 3 15.6" Ryzen 5 7520U 7000 Ser 16GB 1TB SSD Radeon Graphics Refurb
$384.16

Apple iPad Pro 12.9" 5th Gen 128GB 256GB 1TB 2TB Wi-Fi Or Cellular - Good
$489.99

2026 NEW SGIN 15.6" Laptop Win11 Intel i3 16GB RAM 1TB SSD Wi-Fi 6 RJ45 USB-C
$302.99

1TB SanDisk Extreme Portable SSD (Recertified) - A196-SDSSDE61-1T00
$150.99