An article on The Register linked to a GitHub shell script version of Wordle, and what caught my eye was that apparently a Linux installation contains a dictionary of English words in the file /usr/share/dict/words
.
If you are stuck in your daily Wordle, you can use this file to figure out solutions:
Command | Purpose |
---|---|
grep -E '^([a-zA-Z]){5}$' /usr/share/dict/words | collect all 5-letter words |
tr '[a-z]' '[A-Z]' | convert words to upper case |
grep 'RU...' | filter words for matching (green) letters |
grep '[E]' | filter words for letters in the wrong spot (yellow) |
grep -v '[ASD]' | exclude known wrong letters (dark grey) |
Combine the commands (the last 3 are optional) with the respective letters filled in, separated by the pipe “|”:
$ grep -E '^([a-zA-Z]){5}$' /usr/share/dict/words | tr '[a-z]' '[A-Z]' | grep 'RU.E.' | grep -v '[TASDLMN]'
RUPEE