2

I would like to get everything inside one directory.

How can I copy entire directory (that originally contains files and symlinks) to a new directory that should contains all files but no symlink??

Thank you

2
  • do a small bash script Nov 22, 2012 at 14:53
  • lol, this is not the question
    – Julio Fong
    Nov 22, 2012 at 14:53

2 Answers 2

3

Run this command

find (Old dir) -depth -type f -o -type d | cpio -pamVd /New/Directory

it will only copy files and directories, but not symlinks

Example:

find . -depth -type f -o -type d | cpio -pamVd /root/mydir

this will recursively copy all the file/directories from current directory to /root/mydir

2
  • does OP want symlinks converted into files or just ignored? Apr 12, 2014 at 8:04
  • not sure about that
    – Farhan
    Apr 13, 2014 at 18:56
1

Or simply copy everything, then delete the symlinks.

cp -R /path/source /path/dest; find /path/dest -type l -exec rm -f {} \;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .