iHow to use this guide
This guide walks you through the hunt one stage at a time. Use it next to the terminal (sandbox.bio) and the field notebook.
- Stage 0 is open. Every other stage opens here when you type its Notebook code, printed at the top of that stage's CLUE.txt.
- Each stage starts with the background you need, then hints that get more detailed one at a time. Open only as many as you need: the last hint is close to the answer.
- Really stuck? Each stage ends with a Spoiler button. Hold it down for three seconds to see the answer and the full command. Use it to keep moving, then go back and understand why it works.
- You never need to write awk or "regular expressions" from scratch. Every command is given:
your job is to understand what it does and change the one part marked
___. - Your progress stays in this browser. Write your passwords on your answer sheet too: you need them to come back later.
↺Coming back later
The terminal forgets your files when you close its tab. To carry on later:
Repeat bash unlock.sh N <password> for every stage you reached. The field notebook's Coming back later box builds these lines for you from the passwords you saved there. Stage 5 includes the filtered file from stage 4, so you do not need to redo stage 4.
?Command glossary
- Where am I?
pwd, ls, cd pwdprints the folder you are in (likegetwd()).lslists what is there (list.files()).cd stage1goes into a folder (setwd());cd ..goes back up;cd ~/migrant-fishgoes to the main folder from anywhere.- Look inside a file
cat, head, less cat fileprints all of it.head -n 5 fileprints the first 5 lines (head(x, 5)).less filelets you scroll; press q to quit.- Compressed files
gzip -dc - A name ending in
.gzis compressed.gzip -dc file.gzprints the unpacked text to the screen and leaves the file as it is. - The pipe
| - Sends what one command prints into the next command, like
|>in R.gzip -dc file.gz | headreads: unpack, then show the first lines. - Counting
wc -l - Counts lines (
length(x)). - Finding lines
grep grep 'word' fileprints the lines that contain word (x[grepl("word", x)]). Add-cto count them,-vto keep the lines that do NOT match,-wto match whole words only,-A 3to also print the 3 lines after each match.- Columns
cut -f cut -f 2,3 filekeeps columns 2 and 3 of a tab-separated file (df[, c(2, 3)]).- Sorting
sort -k sort -k5,5nrsorts on column 5, as numbers (n), largest first (r), likedf[order(-df[[5]]), ].- Small programs
awk - awk reads a file line by line. A command looks like
awk 'CONDITION {ACTION}' file: on every line where the condition is true, it does the action.$1,$2... are the columns,NRis the line number,-F'\t'says columns are separated by tabs. You will only ever change a number or a word in the awk commands given here. - Character sets
[!-4] - Inside
grep, square brackets mean "any ONE of these characters".[!-4]means any character from!to4in the ASCII table.LC_ALL=Cin front makes the computer use plain ASCII order. - Unlocking
bash unlock.sh bash unlock.sh 2 secretopens stage 2 with the password secret. Run it from the main folder (cd ~/migrant-fishfirst).- Saving a file to your laptop
download download filtered.vcfsaves that file from the terminal to your computer.