I'm trying to copy a folder (
SRC
) containing some files and subfolders.
The content and SRC
itself have setgid bit enabled (that is the s
in place of the x
in the group triplet). Furthermore, the group of the whole content is srcgrp
while the files have different owners (let's say me
, she
and they
).
Now, I want to copy all the folder (SRC
included) into another folder (let's say /mnt/d/SRC
to /home/dog/data/SRC
).
The problem is as follows: when I prompt cp -Rp /mnt/d/SRC /home/dog/data/SRC
the folder is being copied in /home/dog/data/SRC
but the owner of all the contents become me
, even if I give chmod g-s /home/dog/data
previously.
I'd like to keep the owners of source files. How could I get it?
Thank you.
Asked by user9952796
(81 rep)
May 6, 2024, 08:02 AM
Last activity: May 6, 2024, 02:18 PM
Last activity: May 6, 2024, 02:18 PM