How do you use the
cp command without changing the target file's permissions? For example:
cp /tmp/file /home/file
I don't want to change
If you've only opened the manual for
The next will not overwrite the file permissions and ownership + groupship:
cp --no-preserve=mode,ownership /tmp/file /home/file
Note that root privileges are needed if you want to preserve the ownership and groupship.
An excerpt from the manual:
--preserve[=ATTR_LIST] preserve the specified attributes (default: mode,owner- ship,timestamps), if possible additional attributes: context, links, xattr, all
Or you can use even better install program from GNU coreutils that has been made for this particular purpose. Please note it is not able to recurse (no -R or -r option).