问题
I want to use tar
to preserve only file names, file contents, and the executable bit for the owner (and ignore the executable bit for group and other). The command I have come up with is
tar -cf <name>.tar --numeric-owner --owner=0 --group=0 --mode="go-rwx,u-rw" <files>
I would like the output <name>.tar
not to change unless I change the file name, file contents, or owner's executable bit in one or more of <files>
. Assume that the <files>
are in sorted order by name.
Will the command that I have written do that?
来源:https://stackoverflow.com/questions/45734702/tar-preserving-only-file-names-contents-and-executable-bit