Lab 2. Linux

For the activities in this lab, first log in to your Linux as you did in Lab 1. Perform a git pull on your repository to make sure it is up to date.

This lab has the following goals:

  1. Gain experience navigating the Linux environment.
  2. Gain experience using a terminal-based text editor---Vim.
  3. Get acquainted with Assembly programing.

Part 1. Solve the Mystery

Use cd to navigate into your lab2 directory. Once you're in there, use the ls command to list that directory's contents. Then use cd to go into the clmystery directory. You'll notice a file named instructions! Read it using the cat command.

Some shotcuts you may find useful:

While following the instructions to solve this problem, please take notes to show your thought process, i.e., how you reach to the final conclusion. After you've solved the mystery, show the final answer and your note to your instructor and get checked off!

Part 2. Terminal-based Text Editor Training

The Linux command-line terminal, or shell, is an extremely powerful tool. In Linux, you control the machine solely through this text-based input.

One common task on the command line is text editing (analogous to using Notepad on Windows or TextEdit on Mac.) For simple text-editing tasks, one can use nano. However, it is very worthwhile to learn a more sophisticated editor such as vim or emacs. These editors come with a slightly steeper learning curve, but once a user is up to speed, their many useful functionalities can boost productivity. In this part of the lab, you'll get to know one of these text editors.

In this class, we will choose Vim as the text editor

Vim

vim should already work on your Linux install.

If you like, you can run the following command in the terminal to install some useful configurations, e.g., showing line numbers.

wget -O ~/.vimrc https://www.rose-hulman.edu/class/csse/csse132/vimrc

Read the Tutorial: Run vimtutor to open the official tutorial. There are 7 lessons in total in this tutorial, but you only need to go through lesson 1 to lesson 6. When you are reading the tutorial, write down the keyboard shortcuts for following operations on your instructor verification sheet:

Tip: You may be used to hitting CTRL-z to undo. But on Linux, CTRL-z is used to suspend the current process (leaving it running in the background) and return to the shell. If this happens to you while using vim, type fg at your terminal to bring vim back to the foreground.

Show your instructor

To check this item off from your instructor verification sheet, you will be tested to demo some of the operations mentioned above.

Part 3: Assembly Practice

Finishing the Lab

  1. Scan and upload the signed instructor verification sheet to Gradescope.