copying of files by userB, dir & files owned by userA

I am userB and have a dir

/temp1

This dir is owned by me.

How do I recursively copy files from another users's dir userA?

I need to preserve the original user who created files, original group information, original create date, mod date etc.

I tried

cp -pr /home/userA/* .

but it shows the files as being created by me.

So how do I do this?

Thanks in advance.

:slight_smile:

use cpio or tar

Assuming you have read permissions to userA's files:
One way (with cpio). This method is described in both "man find" and "man cpio".

cd /home/userA
find . -type f -print|cpio -pdumv /temp1