The Goal
The password for Level 9 is the only line that appears exactly once in data.txt.
All other lines are repeated.
The Approach
uniq -u prints only unique lines, but it only compares adjacent lines. Running
it directly on the unsorted file still prints duplicates. The file needs to be sorted first
so that identical lines end up next to each other, allowing uniq -u to work
correctly:
bandit8@bandit:~$ cat data.txt | sort -d | uniq -u
password
Commands Covered
sort -d, sort lines in dictionary orderuniq -u, print only lines that appear exactly once (requires sorted input)