Bandit
Level 8
The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
Solution
Our task is to find a line that occurs only once in a file.
Final Command:
$ cat data.txt | sort -R | uniq -c | sort -n | head
Breakdown:
- cat data.txt | Output contents of file
- sort -R | Group identical entries together
- uniq -c | Print the identical count
- sort -n | Numeric Sort, ascending order
- head Print first 10 entries
Above command prints number of times a unique line occurs in a file, result is sorted numerically.
Solution Screenshot:

Takeaway
- Chaining commands = win