Results 1 to 3 of 3

Thread: Help saving lots of time

  1. #1
    Join Date
    Aug 2011
    Beans
    1

    Unhappy Help saving lots of time

    I have a bout fifty folders filled with music files, and i was wondering if there was a way to extract all the files without going into all the folders and doing a copy all then paste into a destination folder. if anyone could help it would be wonderful.
    Thanks

  2. #2
    Join Date
    Jun 2011
    Location
    Grand Forks, ND
    Beans
    113
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Help saving lots of time

    I wanted to do the same thing with .iso files from my downloads folder.

    Code:
    for file in `find ~/Music`
    do
    if echo $file | grep ".mp3"
    then
    mv $file DESTINATION
    fi
    done
    Replace Music with whatever main directory the folders are in, and if they aren't all mp3s then change that to .* for all files or specify exactly which types. Run it as a script or from the terminal.

    Let me know how it goes.

  3. #3
    Join Date
    May 2006
    Location
    Boston
    Beans
    1,918
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help saving lots of time

    actually if you have file different from mp3 just skip line 3 & 4
    grep ".*" will look for termination * since is inside double quotes.

    also instead of mv i 'd use cp -v just in case you dont loose files.

    blog
    Donations BTC : 12FwoB7uAM5FnweykpR1AEEDVFaTLTYFkS
    DOUBLEPLUSGOOD!!

Bookmarks

Posting Permissions

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