981 B
981 B
RHCSA 1.4: Archives and compression
Creating a compressed archive, extracting one file from it, compressing a copy while keeping the original, and an archive that keeps owners, permissions, SELinux contexts and ACLs.
Before you start
The lab installs bzip2, and creates users dana and erik. A file in
dana's home directory, shared.txt, has an ACL that lets erik read it.
Tasks
- Create a bzip2-compressed archive of
/etcnamed/root/etc-backup.tar.bz2. - Extract only
etc/hostnamefrom that archive into/tmp/restore. - Compress a copy of
/var/log/messagesin/tmpwith gzip, keeping the uncompressed copy. - As root, archive
/homewith gzip so that owners, permissions, SELinux contexts and ACLs are kept, to/root/home.tgz.
Hints
tar -cjf;file,tar -tf.tar -xf ARCHIVE -C DIR MEMBER; the directory must exist first.gzip -k, orgzip -c FILE >FILE.gz.tar --selinux --acls --xattrs -czf;tar -tvzf.