Unix Review Practice Session
Author: Stephan Sanders, PhD (UCSF)
In this exercise, we are going to embark on a Unix treasure hunt created by the Sanders Lab at the University of California San Francisco. Note: the treasure hunt materials can be obtained directly from the Sanders lab code repository linked above.
Note to start at the /data/username
folder for this exercise (replace username with the student account ID). To begin create a directory called treasure_hunt
in your data directory (ie. /data/username
) and change into it. Next, run the treasureHunt_v2.pl
perl script in /data/classes/BTEP
.
Read the first clue and begin.
Recommendation: Create an environment variable to store the path to the treasure hunt directory to facilitate movement through the directory.
When you have found the treasure, answer or do the following:
- How many words are in the last line of the file containing the teasure?
- Save the last line to a new file called
finallyfinished.txt
without copying and pasting.
- Now append the first line to the same file that you just saved the last line.
Congratulations! You have found the treasure and have gained some useful unix practice throughout your hunt.