Find the answer to your Linux question:
Results 1 to 2 of 2
I have been looking for a bash (.sh) script or alike (anything that can be run as a linux script) which will copy the files contained within a folder. The ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    2

    Bash script to copy contents of folder

    I have been looking for a bash (.sh) script or alike (anything that can be run as a linux script) which will copy the files contained within a folder. The catch is that i want a new directory created with only part of the directory structure. For example, i want the following copied:

    Code:
    - Test
       - 11
          - 111
             - 8888
       - 12
          - 123
             - 9999
    to:

    Code:
    - Folder
       - 8888
       - 9999
    Any ideas?

  2. #2
    Just Joined!
    Join Date
    May 2009
    Posts
    2

    Solution

    find /Source/*/*/*/*/*/ -type d -exec cp -R {} /Dest/ \;

Posting Permissions

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