1833748 Members
2697 Online
110063 Solutions
New Discussion

cp files

 
TRUONG
Occasional Contributor

cp files

Hello,
I would like to copy all files under a big directory (1,5 Gb) to another directory but it did not work with cp -r dir/* target. Does someone know ? manpage cp can not help me.

Thanks
Sy-Hoang TRUONG
4 REPLIES 4
Andreas Voss
Honored Contributor

Re: cp files

Hi,

try the combination of find and cpio:

cd
find . -depth | cpio -pmdv

Greetings

Andrew
Rick Garland
Honored Contributor

Re: cp files

Do the cpio as described. You will also keep the ownerships when doing the cp.
Michael Lampi
Trusted Contributor

Re: cp files

Another method is
cd source_dir;tar cf - * | (cd destination_dir;tar xfp -)
A journey of 1000 steps ends in a mile.
keh
Occasional Contributor

Re: cp files

Try this if you copy files across harddisk
ufsdump 0f - /dir_1 | (cd /dir_2; ufsrestore xf -)
keh