LPIC-2 Exam 201 (Linux Engineer) — Question 30
Which of the following commands restores only those files containing lpi in their name from the archive lpifiles.tar.gz?
Answer options
- A. tar xvzf lpifiles.tar.gz --wildcards "˜*lpi*'
- B. tar xvzwf lpifiles.tar.gz "˜*lpi*'
- C. tar -xvfz lpifiles.tar.gz --deep "˜*lpi*'
- D. tar -xvzf lpifiles.tar.gz --subdirs "˜*lpi*'
- E. tar xvzf lpifiles.tar.gz --globbing "˜*lpi*'
Correct answer: A
Explanation
The correct answer is A because the --wildcards option allows for filtering files based on patterns, thus restoring only those with 'lpi' in their names. The other options either use incorrect flags or do not support the wildcard functionality needed to achieve the desired result.