Skip to article frontmatterSkip to article content

Unix Scavenger Hunt!

Introduction

Welcome to the Unix Scavenger Hunt! This activity is designed to help you explore and become more comfortable with Unix commands. Each prompt is a mini adventure where you’ll use the terminal to accomplish specific tasks. Feel free to try the challenge in any order!

Rules

  • You can use Google and other resources to find the commands and solutions, but try using man and -h first to see if the documentation makes sense!
  • Make sure to write down/document the commands you use and what those commands do. We will go around and share what we learned at the end of the class time.
  • Try to stick to terminal - don’t use your machine’s GUI to get to the solutions!
  • Have fun and enjoy the exploration!

Scavenger Hunt Challenges

We are sharing a folder with all of you via Slack. Everyone should download a copy of this folder onto their machine for this exercise.

Challenge 1: The Hidden Treasure

Find a file named “treasure.txt.” Navigate to it, retrieve the contents of the file, and share what you’ve discovered!

Challenge 2: Mysterious Sizes

Try to find the directoy with the biggest size in the folder we shared with you. Now try to find the largest individual file. Share the directory name (and/or file name), size, and the command you used to find it.

Challenge 3: The Time Traveler

Find a file with a modification date that is at least one month ago and change its timestamp!

Challenge 4: The Artist

Create a new directory named “masterpiece” and populate it with text files, each containing a line from your favorite quote or poem. Use an editor (either vim or nano, but I recommend vim!) to make your files. Share the commands you used to create and populate the directory.

Then, use a command to print out all your lines of poetry (across the files) one after the other.

Challenge 5: Pipe Explorer

Navigate to a directory containing multiple text files. Use a combination of commands and piping to find and count the number of lines in each text file. Share your results, showing the filename and the corresponding line count for each text file.

Conclusion

Remember, the goal is to have fun and gain hands-on experience with Unix commands. Feel free to experiment and explore beyond the prompts. Happy scavenger hunting!