nerdexam
LPI

101-350 · Question #127

Which approach will provide a listing of the contents in a tar archive?

The correct answer is A. Use the tar command with -t. See the full explanation below for the reasoning.

Question

Which approach will provide a listing of the contents in a tar archive?

Options

  • AUse the tar command with -t.
  • BUse the grep command.
  • CUse the find command.
  • DUse the zless command.
  • EUse the zlist command.

How the community answered

(49 responses)
  • A
    84% (41)
  • B
    10% (5)
  • D
    2% (1)
  • E
    4% (2)

Community Discussion

4
Ingrid P.Ingrid P.Jun 14, 2026

A is the one you card up. The -t flag (think "t for table of contents") tells tar to list archive contents without extracting anything, and it pairs with -f to specify the filename, so "tar -tf archive.tar" is the exact pattern to drill until it is automatic.

18
Bao N.Bao N.May 30, 2026

The only real distractor worth mentioning here is B, since some people try grepping a tarball and get garbage output, which at least teaches you something, but for an actual listing you need tar with the -t flag and that is the end of the story.

2
Marit C.Marit C.Jun 26, 2026

tar -t lists archive contents without extracting, that is the flag.

2
Dervla O.Dervla O.Jun 6, 2026

The only thing I would flag here is that test-takers sometimes second-guess A because they conflate -t with -x and start second-guessing themselves mid-exam, which is exactly the trap the question is setting. Read the stem again: listing, not extracting, so tar -t is the clean answer and nothing else on that list even gets close.

0
Full 101-350 Practice