script to move files out of recursive subdirectories into one parent directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • publishasap
    New Member
    • Sep 2008
    • 1

    script to move files out of recursive subdirectories into one parent directory

    does anyone have a perl script that will take all the files out of recursive subdirectories and move them into one parent directory ... have searched to the end of the earth and can't find anything.
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    Yes, I have such a script. Why do you ask?

    --Kevin

    Comment

    • numberwhun
      Recognized Expert Moderator Specialist
      • May 2007
      • 3467

      #3
      I am sure that any of use here could produce one, but that would not help you learn how to do it. Besides, this is not a scripting service, but instead is a learning forum.

      Why not try to do it and post your code here if you get stuck.

      Regards,

      Jeff

      Comment

      • fbnewtz
        New Member
        • Oct 2007
        • 2

        #4
        very simple.

        find . -type f -exec mv {} /path/to/directory \;

        Thanks,

        Fred

        Comment

        • numberwhun
          Recognized Expert Moderator Specialist
          • May 2007
          • 3467

          #5
          Originally posted by fbnewtz
          very simple.

          find . -type f -exec mv {} /path/to/directory \;

          Thanks,

          Fred
          That is one way to do it using shell, but this is a Perl forum and if you read the thread, we are waiting for the OP to post the code that they have been trying.

          Regards,

          Jeff

          Comment

          Working...