Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: do something with all files in all subdirs

  1. #1
    Senior Member registered user
    Join Date
    May 2003
    Location
    Utrecht, The Netherlands
    Posts
    298

    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)

  2. #2
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    555
    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.

  3. #3
    Senior Member registered user
    Join Date
    May 2003
    Location
    Utrecht, The Netherlands
    Posts
    298
    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.

  4. #4
    Senior Member registered user
    Join Date
    May 2003
    Location
    Utrecht, The Netherlands
    Posts
    298
    (the first command replies: xargs: unmatched single quote)

  5. #5
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    555
    Quote 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)

  6. #6
    Senior Member registered user
    Join Date
    May 2003
    Location
    Utrecht, The Netherlands
    Posts
    298
    aaah, tnx, I'm trying it now...

  7. #7
    Senior Member registered user
    Join Date
    May 2003
    Location
    Utrecht, The Netherlands
    Posts
    298
    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!

  8. #8
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    555
    Quote Originally Posted by Superstoned
    looks like the directory's (and long filenames) are the problem?!?
    Indeed embedded spaces seem to interfere; try
    Code:
    id3v2 -d \"$file\"
    Cheers,

    bald.

  9. #9
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041
    --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
    Quote 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!

  10. #10
    Senior Member registered user
    Join Date
    May 2003
    Location
    Utrecht, The Netherlands
    Posts
    298
    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
    (...)

Page 1 of 2 12 LastLast

Similar Threads

  1. Rar Files in Ark
    By sunpascal in forum The Lounge
    Replies: 5
    Last Post: 01-13-2010, 07:06 AM
  2. what to do with .bin files?
    By jehan60188 in forum MS Windows & New to Linux
    Replies: 2
    Last Post: 01-23-2005, 11:57 AM
  3. iso files
    By pc3 in forum General Support
    Replies: 3
    Last Post: 06-27-2004, 01:18 PM
  4. Writing to / and subdirs.
    By bikerman in forum General Support
    Replies: 1
    Last Post: 04-15-2004, 12:22 AM
  5. *.run files
    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
  •  


🔀 Juniper Networks EX2300-C-12P 12× Gigabit PoE+ • 2× 10G SFP+ Compact Switch ⚡ picture

🔀 Juniper Networks EX2300-C-12P 12× Gigabit PoE+ • 2× 10G SFP+ Compact Switch ⚡

$119.00



Juniper EX2300 12-Port Gigabit PoE+ Managed Network Switch P/N: EX2300-C-12P picture

Juniper EX2300 12-Port Gigabit PoE+ Managed Network Switch P/N: EX2300-C-12P

$149.99



Juniper Networks EX2300-48P 48-Port Gigabit PoE Managed Ethernet Switch picture

Juniper Networks EX2300-48P 48-Port Gigabit PoE Managed Ethernet Switch

$79.99



Juniper Networks SRX340 16x1GbE Ports Service Gateway Security Appliance W/ Ears picture

Juniper Networks SRX340 16x1GbE Ports Service Gateway Security Appliance W/ Ears

$79.99



Juniper SRX320 8-Port Security Services Gateway Appliance w/ AC Adapter picture

Juniper SRX320 8-Port Security Services Gateway Appliance w/ AC Adapter

$59.99



Juniper  QFX5100-48S-AFO 48 Port SFP 6 Port QSFP Switch w/ DUAL PSU picture

Juniper QFX5100-48S-AFO 48 Port SFP 6 Port QSFP Switch w/ DUAL PSU

$325.00



Juniper EX2300-C-12P POE+ Switch 12 x 1GbE & 2 SFP+ 10G uplinks picture

Juniper EX2300-C-12P POE+ Switch 12 x 1GbE & 2 SFP+ 10G uplinks

$149.99



New Sealed Juniper EX4100-F-12P 12x 1GbE PoE 2x 10GbE uplinks 1 Year Warranty picture

New Sealed Juniper EX4100-F-12P 12x 1GbE PoE 2x 10GbE uplinks 1 Year Warranty

$895.00



Juniper Networks EX3400-24T 24-Port Ethernet Switch w/Power Cord picture

Juniper Networks EX3400-24T 24-Port Ethernet Switch w/Power Cord

$174.99



Juniper Networks EX3400-48P 48 Port PoE+ Gigabit Switch picture

Juniper Networks EX3400-48P 48 Port PoE+ Gigabit Switch

$184.99