LPIC-1 GNU and Unix Commands Practice Question
A Linux administrator needs to archive the /etc directory into a compressed tarball at /backup/etc_backup.tar.bz2. The administrator wants to see the progress of the archiving process as files are added. Which command should be used?
⚠ Common exam trap
A common mix-up: candidates confuse the -z (gzip) and -j (bzip2) compression flags, especially when the filename extension suggests one format but the command uses another.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
tar -cjvf /backup/etc_backup.tar.bz2 /etc
To create a bzip2-compressed tar archive with verbose output, the correct combination is tar -cjvf. The -j flag invokes bzip2, -c creates the archive, -v shows progress, and -f specifies the output file. This ensures the archive is both compressed and the administrator can monitor which files are being added during the process.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
tar -czvf /backup/etc_backup.tar.bz2 /etc
Why it's wrong here
The -z option uses gzip compression, which would create a gzip-compressed archive, not bzip2. Although the filename ends in .tar.bz2, the actual compression format would be gzip, causing confusion and potential incompatibility with tools expecting bzip2. This does not meet the explicit bzip2 requirement.
- ✗
tar -cvf /backup/etc_backup.tar.bz2 /etc
Why it's wrong here
This command creates an uncompressed tar archive because it lacks a compression option like -j or -z. The filename suggests bzip2 compression, but the resulting file would be a plain tar archive, larger in size and not actually compressed. It would not meet the compression requirement.
- ✗
tar -xjvf /backup/etc_backup.tar.bz2 /etc
Why it's wrong here
The -x option extracts an archive rather than creating one. Using -x with a non-existent archive would fail, and even if the archive existed, this would attempt to extract files to the current directory, not create a backup. This command is for extraction, not creation.
- ✓
tar -cjvf /backup/etc_backup.tar.bz2 /etc
Why this is correct
The -j option tells tar to use bzip2 compression, -c creates a new archive, -v enables verbose output to list files as they are processed, and -f specifies the archive filename. This matches the requirement to create a compressed archive with visible progress, producing a .tar.bz2 file from /etc.
Go deeper
Related to this question
About these practice questions
This LPIC-1 question is part of Courseiva's 402-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official LPI exam blueprint
This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.