Strip files out of folders?

Discussion in 'macOS' started by isaacc7, Nov 12, 2005.

  1. isaacc7 macrumors regular

    Aug 31, 2004
    I have a really large folder that has many many subfolders, like 500 and many of them have subfolders as well. Is there an app or a script or action that will strip all of the files out of the subfolders? I want to eliminate all of the folder heirarchy but retain all of the data. Any suggestions?

  2. mad jew Moderator emeritus

    mad jew

    Apr 3, 2004
    Adelaide, Australia
    Could you use Automator if you have Tiger?

    Something like Find Finder Items, Where: original folder, Kind: is not folder.

    Then, Move Finder Items To new folder.

    Did that make any sense? :eek:
  3. ToastyX macrumors regular

    Oct 4, 2005
    This is very easy to do in a terminal.

    First, create a new folder for the files to go into.
    Then open Applications -> Utilities -> Terminal.
    Then type in the following, but replace the underlined parts:

    find source -type f -exec cp -p {} destination \;

    Replace "source" with the path to the folder containing the files.
    Replace "destination" with the path to the new folder.

    You can drag and drop the folder into the terminal window, and it will type out the path for you.

    After the command completes, you will be returned to the prompt, and the new folder will have a copy of the files. Be aware that if you have more than one file with the same file name, only one of them will be in there. If you're satisfied with the results, you can trash the old folder.
  4. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
    I've used info-zip zip & unzip to do this on occasion, just junk the paths on unzip

    zip -mr folder
    unzip -j

  5. isaacc7 thread starter macrumors regular

    Aug 31, 2004

    Great ideas guys, I'll try them out later tonight. On a related note, if I burn a DVD from the finder (in tiger), will it be readable on a windows system? I'm trying to both back up my music collection and move it to another computer (which is running windows). Thanks for the info!


Share This Page