Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
    
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 –  Jonathan de M. Aug 7 '13 at 7:14

2 Answers 2

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

share|improve this answer

how about:

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

?

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

share|improve this answer
1  
It works but it doesnt copy the symlink and the folders, I'd like to copy everything from a folder except the symlink –  Jonathan de M. 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 –  user1293137 Aug 7 '13 at 7:31

Your Answer

 
discard

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.