I'd like to copy everything recursively from a folder but the files symlinked from an other directory, how can I achieve that?
2 Answers
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)
how about:
find ./ -maxdepth 1 -type f -exec cp {} destfolder \;
?
( or you meant "except files symlinked 'elsewhere' ? )
-
1It works but it doesnt copy the symlink and the folders, I'd like to copy everything from a folder except the symlink Aug 7, 2013 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, 2013 at 7:31
symlinked
, do you meanfiles which are symlinks to other files
orfiles who are symlinked somewhere else
?