Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move file as root preserving ownership linux [closed]

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

like image 793
Rombus Avatar asked Aug 20 '13 20:08

Rombus


1 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

like image 185
Radu Toader Avatar answered Nov 10 '22 07:11

Radu Toader