Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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!

share|improve this question
Do you use bash? Do you want to copy each sub-directory? (as I changed your question) – olibre Nov 15 '12 at 8:31
I've flagged your question as exact duplicate, sorry :) The answer is here: – Artem Koshelev Nov 15 '12 at 8:37
Hi, well it's the macos shell. – Jem Nov 15 '12 at 8:47
I'm trying to simply do: cp -L ./stones ../stones_as_folder to copy the folder pointed to by the "stones" symbolic link, but I end up with a copy of the symbolic link – Jem Nov 15 '12 at 8:48
up vote 1 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.