Transfer a root file

OS: Debian. I want to be able to move files and folders around as root and from the command line without changing the owner and group. Is it possible?

+6
source share
2 answers

rsync:

-A, --acls preserve ACLs (implies --perms) -X, --xattrs preserve extended attributes -o, --owner preserve owner (super-user only) -g, --group preserve group --devices preserve device files (super-user only) --specials preserve special files 

man rsync

+9
source

The mv team retains ownership and time stamps. There are various command line options for the cp command that you can use. for instance

 cp -p file1 file2 

man cp display all available options

+5
source

Source: https://habr.com/ru/post/952159/


All Articles