No announcements

Goal

Get to know the basic tools that you need to do just about anything with Linux and C: the Bash shell and the Emacs text editor.

What you'll need

  • Card-key access to Lindley 035 (LH 035)
  • Login privileges to the Burrow machines

If you don't have these privileges, go to the Computer Science office at LH 215 and present your student ID card to get key access.

What to do

Set-up: Log in to one of the Linux machines in LH 035 and start a terminal window. In the terminal window, type emacs at the shell prompt. An Emacs window will appear. In the Emacs window, type Alt-x shell and hit return. That will start a "shell window", where you'll enter shell commands and see their results. You'll send in the contents of this window as the result of your lab, so you should start a second shell window, too, where you can experiment and make a mess. At each stage, when you feel like you know what you're doing, do the same commands in the shell window that you're keeping nice and neat.

At any time, to save the contents of your main lab window, type Ctrl-X Ctrl-S and enter this filename: usernameLab1Transcript (where username is your login ID). To exit Emacs, type Ctrl-X Ctrl-C.

Each of the following tutorials tells what commands to type in the shell window:

  1. Directories. Don't type parenthetical remarks, like (short for list).
  2. Files. One instruction in the tutorial is out of date. To get science.txt, type curl https://www.cs.indiana.edu/classes/c335/lab1/science.txt > /tmp/science.txt. Then you'll need to copy science.txt from the /tmp directory to the current directory.
  3. Input/output redirection. In section 3.4, the printer to send to is psburrow rather than hockney. The psburrow printer is in the Burrow lab, at the opposite end of the hall.
  4. Wildcards and getting information.
  5. Privileges and processes. To send a Ctrl-C to the shell from the Emacs shell window, hit Ctrl-C Ctrl-C. To send a Ctrl-Z to the shell from the Emacs shell window, hit Ctrl-C Ctrl-Z.
  6. Other useful Unix commands.

If you get stuck or aren't sure what to do, ask the lab assistant for help: Greg Smith or Ben Kovitz, depending on which lab you're in.

What to turn in

You'll send in:

  • The usernameLab1Transcript that you created in your (nice, neat) Emacs shell window.

To submit homework, log in to Vincent and upload your transcript file as lab1. (Don't submit as Lab1. That was a mistake; I'm still trying to figure out how to delete it.)

If Vincent isn't set up for you yet, email the transcript file to yourself (as an attachment), and email Ben at bkovitz@indiana.edu that you ran into a problem.

Deadline

The deadline to submit your lab is 11:59:59 p.m. on the day one week after your lab. So, for example, if your lab meets on Thursday, then the deadline is 11:59:59 p.m. on the next Thursday.

More info (optional)

All the details about the Emacs shell window: http://jamesthornton.com/emacs/node/emacs_442.html

The entire Emacs manual: http://jamesthornton.com/emacs/node/emacs.html#SEC_Top

A simple page of Emacs basics: http://mally.stanford.edu/~sr/computing/emacs.html

It's actually OK to ask your lab assistant what grep stands for, but be warned that the answer is pretty long and scary.