The tar command is useful for bundling up multiple files and/or directories.
In a sense, it is similar to the zip command. However, zip files are compressed by definition; tar files can be compressed, but do not have to be.
The tar utility does not retain extended attributes by default. Since SELinux contexts are stored in extended attributes, contexts can be lost when archiving files.
command to create archives that retain contexts and to restore files from the archives.
If a tar archive contains files without extended attributes, or if you want the extended attributes to match the system defaults, use the restorecon utility: