Find the answer to your Linux question:
Results 1 to 2 of 2
HI -- Let's say that all of my music files are in folders/subfolders. like this: /mnt/music/artist/album/tune.mp3 Now let's say I would like all of the music files to be in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2004
    Location
    New England
    Posts
    59

    find, cp, iname, -exec...whaaa


    HI --

    Let's say that all of my music files are in folders/subfolders.
    like this:
    /mnt/music/artist/album/tune.mp3

    Now let's say I would like all of the music files to be in one big directory:
    /mnt/music/tune.mp3

    Is there a utility that will extract folder contents up to 4 levels deep?

    or how about help with this string:
    find /mnt/music -iname "*.mp3" -exec cp '*.mp3' /mnt/music

    Thanks

  2. #2
    Just Joined!
    Join Date
    Aug 2004
    Location
    New England
    Posts
    59
    SO I got some assistance with this one at another forum...here goes the command to accomplish what I wanted:

    find /mnt/music -iname "*.mp3" -exec cp '{}' /mnt/music ';'

    FInd all ot the .mp3 files in the music directory (doesn't matter that they are in subfolders)
    copy (or mv) every found one '{}' to the root /mnt/music directory

    can also use -exec echo cp (or mv) to see what's going on.

    machiner

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •