The Goal

The password for Level 8 is stored in data.txt next to the word millionth.

The Approach

grep searches file contents for a pattern and prints matching lines. Piping the file into grep for "millionth" returns the one line containing both the keyword and the password:

bandit7@bandit:~$ cat data.txt | grep millionth
millionth password

Commands Covered

  • grep <pattern>, print lines matching a pattern
  • cat file | grep pattern, pipe file contents into grep