MayADevBe Blog

A Blog about Computer Science

OverTheWire Bandit Level 8 -> 9 - Walkthrough

Previous Level: Level 8


SSH: ssh -p 2220

Password: cvX2JJa4CFALtqS87jk27qwqGhBM9plV


The password for the next level is stored in the file data.txt and is the only line of text that occurs only once.

A little bit of Theory

uniq is a command that filters input and writes to the output. Specifically, it filters based on identical lines. It has a flag -u, which filters for unique lines (lines that appear only ones). Another interesting functionality is, for example, that it can also count (-c) or only return duplicate lines (-d).

The command is often used with sort. For uniq to filter for unique lines, the lines need to be sorted. sort sorts the lines of a text file. Furthermore, it has flags for sorting in reverse (-r) and sorting numerically (-n).


To find the line that occurs only once in the file, we first sort the lines and then filter for the unique one.

bandit8@bandit:~$ sort data.txt | uniq -u

Next Level: Level 10

Share on: