Terminal Adventure
This lab will explore one of the most important tools we'll use in this course: the Terminal. While it may seem complicated at first, it will quickly become your go-to tool for computer science class. The Terminal is what we'll use to navigate our filesystem, run code files, install software, and do all kinds of other tasks.
Terminal Adventure Lab
๐ป
Open a Terminal window and run mwc update
. It's a good idea
to run mwc update
every time you start
a new lab to make sure you have the latest and greatest.
๐ป
Open a new Terminal window and enter the commands below, one at a time.
(Don't type the $
.)
$ cd Desktop/making_with_code/mwc1/unit1/lab_terminal
$ poetry shell
$ ls
adventure
fancy_printing.py
poetry.lock
pyproject.toml
return_to_ship.py
return_to_ship.py
is a runnable Python file (you can tell by the .py
at the end).
pyproject.toml
and poetry.lock
are a configuration files. You'll see them in every lab,
and you may ignore them every time.
๐ป
Run return_to_ship.py
to see what happens:
$ python return_to_ship.py
Your adventure has only just begun. You are not yet ready to
return to the ship. More secrets await you in the ocean's depths.
Use `ls` to look around, and use `cd adventure` to start the
adventure...
Your challenge is to see if you can find the treasure and bring it back to the ship, using just the Terminal.
๐ป
Begin by going into into the adventure
directory and looking around:
$ cd adventure
$ ls
seafloor sinking.txt
sinking.txt
is a text file, so we can read it.
๐ป
Use the cat
command to print out the contents of a file:
$ cat sinking.txt
Terminal Commands
Here are some Terminal commands which might come in handy on your adventure.