'install' command: copy files while changing permissions and owners
The ‘install’ command allows to copy files and set attributes to the copied files using a very straightforward syntax.
Table of Contents
install <SOURCE> <TARGET>
install file1 file2
install set the following permissions on the copied file:
755. Check the following section to know how to change that.
<TARGET> can be a directory or a file.
You need root permissions to change some file attributes (like the owner).
-m <permissions>: set file permissions (using a numeric code).
install -m 600 file1 out/file2
-o <owner>: set the file owner.
-g <group>: set the file group.
install -m 600 -o ricardo -g ricardo file1 file2
-p: preserve timestamps.
If you have any suggestion, feel free to contact me via social media or email.