RH124 v8.2 CH13 Part 1: Archiving and Transferring Files (tar, gzip, bizip2)
Which tar options allows you to preserve ACLs and SELinux context?
--xattrs
Which tar option allows you to use xz compression while creating the tar-ball?
-J
Which tar options do you need to create an archive?
-cf
Which tar options do you need to create an archive with verbose output?
-cvf
Which tar option is always the last one when creating or extracting an archive?
-f
Which tar option allows you to use bzip2 compression while creating the tar-ball?
-j
which tar option would allow you to list the content of an archive?
-t
Which option is used to restore files from an archive?
-x
Which tar options would extract the tar-ball configfiles.backup.tar?
-xf
Which tar option allows you to use gzip compression while creating the tar-ball?
-z
What comes after the tar -f option?
Name of tarball
True or False: Archives are created in the current directory unless otherwise specified.
True
True or False: The tar command extracts files relative to the current working directory.
True
Which tar option allows you to use xz compression while creating the tar-ball?
tar -cJf filename
What command would archive the passwd, hosts, and libc files into a tar-ball named foo.tar without their parent directories as part of the archive? /etc/passwd /etc/hosts /lib/libc.a
tar -cf foo.tar -C /etc passwd hosts -C /lib libc.a
Which of these tar commands would successfully create a tar-ball of /etc named mybackup.tar? choose one 1. tar -cfv mybackup.tar /etc/ 2. tar -fvc mybackup.tar /etc 3. tar -cvf /etc/ mybackup.tar 4. tar -cvf mybackup.tar /etc/
tar -cvf mybackup.tar /etc/
You want to make an archive of the files in /etc without including the /etc/ directory itself. How would you accomplish this without moving from you present location in the filesystem?
tar -czf etc.files.tar.gz -C /etc .
How would you list the content of etc.backup.tar
tar -tf etc.backup.tar
How would you list the files in mytarball.tar without extracting them
tar -tf mytarball.tar
List the content of the configfiles.backup.tar and display any file with passwd in its name
tar -tvf configfiles.backup.tar | grep passwd
You're currently in /root and want to extract a tar-ball of /var/log to its original location. The name of the file is: logs.backup.tar. What command would accomplish this without moving from /root?
tar -xf logs.backup.tar -C /
How would you use tar to extract a tar-ball that has been compressed with bzip2?
tar -xjf filename
How would you use tar to extract a tar-ball that has been compressed with gzip?
tar -xzf filename