tutorial · bandit

Bandit Level 8 → 9

Sort repeated records and isolate the only unique line.

By

banditsortuniq
Marks this level complete in your browser.

Goal

In data.txt, find the only line that occurs once.

Why this matters

Frequency analysis is useful for finding anomalies, duplicates, and one-off records.

Progressive hints

  1. Hint 1

    uniq compares adjacent lines only.

  2. Hint 2

    Sort first so identical values become adjacent.

  3. Hint 3

    Ask uniq to count or show only unique records.

Method

Run only the lines that match the evidence you observe.

sort data.txt | uniq -c
sort data.txt | uniq -u

Expected non-secret observation

The count view shows one record with frequency one; the unique-only view prints it directly.

Explanation

sort groups equal lines and uniq then measures or filters consecutive duplicates.

Troubleshooting

  • Do not reverse the pipeline.
  • Ensure the data is passed through stdin with the pipe operator.

Safety and cleanup

  • Use only the OverTheWire game host and your own local practice directory.
  • Do not paste a level password into this site, screenshots, notes, or submissions. Baitaphish never asks for credentials.
  • Treat commands as learning prompts: inspect paths and flags before running them.

Completion and next step

Use the recovered credential only in the official Level 9 login. Then mark this transition complete and continue.