1

I've got this ./image folder full of symbolic links to "real" folders. These "real" folder contain a series of images.

./image/stones -> somefolder/stones
./images/grass -> someotherfolder/grass
(etc.)

I try to run a script that will copy the contents of these folders from the ./image folder.

mkdir ../SCALE50

for dir in *; do

    echo $dir
    cp -R $dir/ ../SCALE50/$dir

done

the problem reported by command line is that

arch/*: Not a directory

I've almost no experience with command line, but I understand I should say "follow each symbolic link and copy the contents of that folder to the specified location".

Can't find how to phrase that in google. Thanks for your help!

oHo
  • 3,563
Jem
  • 219

1 Answers1

2

rsync is what you need, look at parameters, you want -r recursive and --copy-links to copy destination file/dir instead of link.

karel
  • 13,706
week
  • 3,336
  • 1
  • 15
  • 15