Unix: Is there a way to "copy" file or directory permissions?
The GNU version of the chmod utility can copy the mode from one file (RFile
) to another (file
).
chmod --reference=RFile file
GNU coreutils is found in most Linux distributions and Cygwin, among other places. Not all chmod implementations provide this option.