Archiving and Compression Flashcards
7 cards from real 010-160 practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Archiving and Compression flashcards as text
Which tar option extracts files to a specific directory instead of the current one?
Answer: -C /path/to/dir
The -C option changes the working directory before performing any operations, so files are extracted there.
What does the `gzip -k` flag do?
Answer: Keep the original file after compression
The -k (keep) flag tells gzip to retain the original file instead of replacing it with the compressed version.
Which command lists the contents of a .tar.bz2 file without extracting it?
Answer: tar -tjf archive.tar.bz2
The -t flag lists contents, -j specifies bzip2, and -f specifies the filename โ no extraction occurs.
What compression format does the `xz` command produce by default?
Answer: .xz using LZMA2
The xz utility uses the LZMA2 algorithm and produces files with the .xz extension by default.
Which tar option appends files to an existing uncompressed tar archive?
Answer: -r
The -r (append) option adds files to the end of an existing archive without recreating it.
What is the purpose of `tar --exclude='*.log'` when creating an archive?
Answer: Skip all files matching the pattern *.log
The --exclude option tells tar to skip any files matching the given pattern during archive creation.
Which command decompresses a .xz file while keeping the original compressed file?
Answer: xz -dk file.xz
The -d decompresses and -k keeps the original, so both the compressed and decompressed files remain.