I don't get a prompt to overwrite. Why not?
Because you're supposed to know what you're doing. Especially as root, you can overwrite pretty much anything, so pay attention to that.
-i option for
cp to get a prompt before overwriting existing files. If you always want to be reminded of this, consider creating an alias for
The permissions are unchanged. But if […] file
someFile does not exist it is owned by
root and not
Because the file you're copying to is already existing. It's not deleted and re-written. It's still owned by
-p option. It will preserve the attributes of the source file, namely the mode, ownership and timestamps. Otherwise, the mode and ownership attributes of the target file will stay (except for the timestamps which will indicate a modification).
If there's no target file, obviously the attributes of the source file need to be copied, since they can't be inherited from a target file. You'll basically just create a new file, and in this case it's owned by