1

I'd like to copy everything recursively from a folder but the files symlinked from an other directory, how can I achieve that?

2
  • By symlinked, do you mean files which are symlinks to other files or files who are symlinked somewhere else ?
    – Levans
    Aug 7 '13 at 7:10
  • I updated my question, hope it's more clear now Aug 7 '13 at 7:14
4

I think I found the solution

rsync -a --exclude='.*' --no-links . destfolder

I tested on my zsh and it copies everything recursively from the current folder except the symlinks and hidden files (bonus)

Source

1

how about:

find ./ -maxdepth 1 -type f -exec cp {} destfolder \;

?

( or you meant "except files symlinked 'elsewhere' ? )

2
  • 1
    It works but it doesnt copy the symlink and the folders, I'd like to copy everything from a folder except the symlink Aug 7 '13 at 7:05
  • just tryied that same command in zsh+fedora17 and it worked. Any error out the copy command / did it find any file? ( -maxdepth 1 = looking only in that dir, not in subdir ). Eventually, check found files via: find ./ -maxdepth 1 -type f -print Aug 7 '13 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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