CS21 Lab 0: UNIX and the editor (atom)
Due Saturday, Jan 25, before midnight
The goals for this lab assignment are:
-
learn about the class
-
get comfortable on the CS computers
-
gain some experience with unix commands
-
learn the basics of the
atom
text editor -
learn how to run our
update21
andhandin21
commands -
practice using piazza
Work through the following sections and ask if you have questions!
1. Read the class web pages
Start by reading through all of the class web page!
Pay special attention to the Schedule, Academic Integrity, and How to succeed in CS21 sections!
You should get into the habit of checking the class page weekly. The class topics, lab assignments, weekly readings, and announcements will be posted to the class schedule each week.
2. Read some useful CS web pages
From the CS homepage please read these important pages:
3. Try running update21
Our update21
command copies any files your professors want you to have from them
to your cs21
directory. It’s a good habit to run update21
each time you log in.
If you haven’t run it already, this will create your cs21/labs/00
directory.
Open a terminal window (click the icon) and enter the commands below after the unix prompt (the dollar sign):
$ update21 # creates cs21 directory, with labs/00 dir below $ cd cs21/labs/00 # cd into the correct directory for lab 00 $ pwd # check to see that you are in the correct directory. # if yes, it will print /home/your_username/cs21/labs/00
If update21
doesn’t work for you, please tell your lab instructor.
4. Learn some UNIX
Read through our UsingUnix web pages and try the various unix commands. These pages are just to help you get comfortable with the unix command line (there’s nothing you have to write or turn in). Make sure you understand the following commands:
-
ls
list out files -
cd
change directory -
pwd
print working directory (where you are) -
passwd
change your CS password -
less
show contents of file (one page at a time) -
cat
show contents of file (all at once) -
mv
move/rename a file -
rm
remove a file -
cp
copy a file -
ssh
secure shell (how to connect to the CS machines)
5. Learn the text editor (atom)
Beginning this week we will start using the text editor in class, so you need to at least know the basics.
All professors teaching this course will use the atom editor.
To practice with atom, open up the atom-practice.py
file in your
cs21/labs/00
directory and follow the instructions in that file.
$ cd cs21/labs/00 # unless you're already in the labs/00 dir $ atom atom-practice.py
Here’s a list of keyboard shortcuts to help you learn the atom text editor. Make sure you at least know how to open a new file, add text, and then save it to the correct directory.
6. Edit the bio.txt
file
For more practice with editing, and so we can learn a little
about you, edit the bio.txt
file in your cs21/labs/00
directory:
$ atom bio.txt
Note: this file should have a few simple questions in it for you to answer.
If you don’t see those questions, make sure you are in the cs21/labs/00
directory (i.e., run the pwd
command), and/or run the update21
command to make sure you get the initial file from your professor.
7. Run handin21
Once you are satisfied with your bio.txt
file, hand it in by typing
handin21
at the unix prompt.
You may run handin21
as many times as you like. Each time you
run it, new versions of your files will be submitted (i.e., any files you’ve
made changes to). Running handin21
after you finish a program, after any major changes are made, and
at the end of the day (before you log out) is a good habit to get into.
handin21 , will grab all files from your cs21/labs/00 directory.
Each week, make sure you create your lab programs and files in the
correct cs21/labs/XX directory!
|
8. Post to Piazza
This semester we’ll be using Piazza, an online QandA forum for class discussion, help with labs, clarifications, and announcements that pertain to all sections of cs21. Our Piazza page is https://piazza.com/swarthmore/spring2020/cs21. You should have received an email invitation to join cs21 on Piazza - if not let us know.
For this first lab, just to get comfortable using Piazza, choose at least
one part of your bio.txt
file above to
post on Piazza (non-anonymously). You can include where you are from,
something else you are doing at Swarthmore, your entire bio, or whatever you
prefer. Add your post to
this thread
as a "new followup discussion".
9. Answer the Questionnaire
Each lab will have a short questionnaire at the end. Please edit
the Questions-00.txt
file in your cs21/labs/00
directory
and answer the questions in that file.
Once you’re done with that, run handin21
again.
10. (OPTIONAL) Make your own website
If you are done early, you are welcome (but not required) to create your own webpage (now or at any time during the semester). To get started, follow these instructions There are many tutorials on how to make a webpage - the Khan Academy tutorial is very comprehensive.
11. Logging out
When you are all done working in the lab, you should log out of the computer you are using. First quit any applications you are running, like the browser and the Terminal. Then click on the logout icon and choose "log out".
If you plan to leave the lab for just a few minutes, and then come right back to work, you do not need to log out. It is, however, a good idea to lock your machine while you are gone. You can lock your screen by clicking on the lock icon.
12. Come to Office Hours!
As part of your Lab 0 grade, each student must visit the office of their lecture professor. If you can come during our official office hours, that is ideal, but you are also welcome to stop by any time we are around. You do not have to have a specific question, you can just drop by to introduce yourself and learn where our offices are. We will have sign in sheets to check you off.
-
Section 1 (Lisa Meeden): 243
-
Section 2 (Aline Normoyle): 252C
-
Section 3 (Jeff Knerr): 238A
Turning in your labs….
Remember to run handin21
to turn in your lab files!
You may run handin21
as many times as you want. Each time it will
turn in any new work. We recommend running handin21
after
you complete each program or after you complete significant
work on any one program.