Lab 1

Introduction to 1311x Labs and UNIX


This lab is due by:
8 AM, Wednesday January 17, 2001
 

[Turnin: Email your name, gt#, and answers to netiquette questions. Make a post to newsgroup.]
 
 

Objectives:
 
1.  Learn how to use telnet so you can get to your account. 
2.  Learn basic Unix because your account is on a Unix machine. 
3.  Learn about bananas, quota, and printing. 
4.  Learn the text editor pico. 
5.  Learn how to use the email reader pine. 
6.  Learn how to use the newsreader tin. 
7.  Learn netiquette. 
8.  Learn workon commands. 

 

Before You Begin This Lab

To do this lab, you must have activated your GT account. If you have not activated your account, refer to Lab 0 for how to do so.

  Rich Cluster This cluster has several dozen UNIX, Macintosh, and Windows NT-based systems. It is located in the Rich Building where you activated your GT account (down the hill from the library). 
  French Cluster This cluster has Windows NT systems and is located in the French Building, which is on the north side of Junior's Grill. 
  Library Cluster This cluster has many Windows NT systems. It is located on the bottom floor of the Library. 
  Student Center Cluster This is a cluster of Windows NT systems. It is located on the middle floor of the Student Center. 
Basic Unix

Although you may be sitting in front of a Windows or Macintosh machine, school computing resources are networked on Unix machines. This means, for example, that the email you send out from your computer travels though a network of Unix machines before it arrives at its destination. Similarly, email that is sent to you travels though a Unix network and ends up on a Unix-based computer system called "acme". If you wish to read your email or work on one of these Unix machines, you need to log i n to them. This is accomplished by running the program Telnet.
 
 

            To connect to the acme systems:
            Go to the Connect -> Remote System... (at the top of the telnet box).
            Type "acme.gatech.edu" in the Host Name textbox. Leave everything else alone.
            After a moment, a prompt labeled "Login: " will appear. Type in your GT-number here and press Enter.

            NOTE: Unix systems are case-sensitive, so don't use capital letters or you will not be able to log in!

            You will now be prompted for your password, which is also case sensitive, so do not use caps unless your password really has them.

  ls This command gives you a directory listing. It is very similar to DOS's dir command. It lists all the files and subdirectories contained in the directory you are currently working in. Like many commands in UNIX, this command   has many options and arguments that can be used to show more information. 

One of the most useful options is the -F flag. Try typing: 

ls -F

and you'll see that there are some characters at the end of some of the file names. Read the man pages to find out what the -F flag does. 

You can also use this command to list only a subset of information in the current directory. Let's say that you want to look through the current directory for all files starting with the letters "da". To do this, you would perform a wildcard search: 

ls da*

The character '*' indicates a wildcard. This means that the operating system will look through the current directory to find any filenames that start with the letters "da" and list them, no matter what the filenames end with. 

  cd This command will change your working directory. For instance, if you were looking at the "Part1" folder in the example from the UNIX File Organization section, and you wanted to open the "Lion" folder, you could type 

cd Lion

to make the "Lion" folder the current one. If you type 

cd ..

it will move you up one directory (back to Part1, in this case). If you type 

cd

alone, it will take you back to your home directory -- the one you start out in whenever you log in. 

  rm This command allows you to remove a file from your account. The format is: 

rm filename

which would remove the file called "filename" from your account. Please note that it does not remove directories that are located inside the current directory without proper flags. Please consult the man pages for more information about the flag s. 

Unlike Windows and Macintosh, there is no "Garbage" folder or "Recycle Bin". When you remove a file, it is a permanent decision, so be careful when using this command (OIT does backup all student accounts nightly, but they will only restore files in extreme circumstances)! 

rm supports wildcard arguments, much like ls does. To use the last example, let's say that you wanted to remove all files inside the current directory starting with "da". Simply type 

rm da*

and all files starting with "da" will be removed. As was noted above, this can be somewhat dangerous. You might delete some files that you don't mean to if they also fit your criteria. To counteract that, we recommend that you use the -i option when performing mass deletions. This option tells UNIX to ask you if you want to delete each file that it is about to delete. The dialog would look something similar to this: 

%prompt% > rm -i da*

Remove daniel? (y/n) y

Remove daniel.txt (y/n) n

Remove daniel.doc(y/n) y

%prompt% >

After this command is completed, both daniel and daniel.doc will be removed from your directory. daniel.txt will remain. 

  mv This command allows you to move a file to a new location or give a file a new name. To rename a file, the format is: 

mv old_filename new_filename

In this case, "old_filename" is the old name of the file, and "new_filename" is the name of the new file. For example, 

mv homework1.backup homework1

would rename "homework1.backup" to "homework1". Note that if you already had a file called "homework1", you would have erased it and replaced it with the contents of homework1.backup! 

To move a file into a directory, the format is: 

mv filename directory_name

where "filename" is the name of the file you are moving, and "directory_name" is the name of the directory that you want to put the file in. 

  more This command allows you to view the contents of any text file without altering the contents of the file. 

more my_file

displays the contents of the file one screenful at a time. In other words, it displays information using as much as the screen as possible until it has filled the entire screen, at which point it pauses. To advance the display one line at a time , press Enter. To advance the display a whole screenful at a time, press the Space key. To quit, press 'q', or continue viewing until you reach the end of the file. You cannot scroll back up the file with more. 

  less "Less is more and more is less." 

That statement essentially sums up the functionality of less. Less is another program that allows you to view text files, and behaves almost exactly like more except for two key differences. Less allows you to scroll back up the file using the up-directional   key on your keyboard. In addition, you can only exit a file by pressing 'q', not by simply reaching the end of the file. 

Side note: Both less and more allow you to search the text file you are viewing to find instances of a specific word or phrase. Simply type '/' and the phrase you want to search for (keeping in mind that this is case-sensitive) and press Enter. Both less and more will bring you to the next instance of that phrase in the file. People who are using more to view documents might have difficulty using this functionality with smaller text files. If more has reached the end of the text file you are vie wing, it brings you back to the UNIX prompt without pausing. Be sure that you are using less or more before trying to perform your search. 

  who Used without arguments, who lists the login name, terminal name, and login time for each current user. Who can also be used to find out what your user name is. Just type either 

who am I

or 

who is who

For information regarding output when using single arguments, consult the man pages. 

cat Displays a file to the screen all at once: 

cat my_file

It's very useful for checking your files for strange characters which may appear if the file is ftp'd in the incorrect mode.  You can see these characters by using the -v flag: 

cat -v my_file

For more information, check the man pages.


 
  total 8            
  drwx------ 2 gt2396a gtpsa 512 Sep 3 15:57 Mail
  drwx------ 2 gt2396a gtpsa 512 Dec 20 1993 News
  -rw-r--r-- 1 gt2396a gtpsa 1056 Sep 7 12:13 hw3.txt
  drwxr-xr-x 2 gt2396a gtpsa 512 Aug 8 20:21 public
 
drwx--x--x  gt1232b  gtpsa  512  Aug 8 20:21  public 
WHO GRANT PERMISSION
u - User (owner)  + give <PERMISSION> to <WHO>  r - read 
g - Group  - remove <PERMISSION> to <WHO>  w - write 
o - Other (World)  = remove all permissions from <WHO> and then give <PERMISSION>  x - execute 
Office of Information Technology (OIT)

The Office of Information Technology controls the computing resources that Tech students access. There are some things that you must know about your account. You can read about these in more detail in the OIT FAQ (Frequently Asked Questions page).

  Option Explanation and default value Possible values you can choose from
  -dest <dest> Specifies the output destination. Default is "central-ps"  rich-ps, which is a PostScript II printer in the Rich cluster 

lib-ps, which is a PostScript II printer in the Library Mac cluster

central-ps, which is a PostScript I printer in Rich. This printer can only print older postscript formats. 

  -type <type> Specifies the type of file to be printed.  text, a standard text file with ASCII carriage returns. 

ansi, a text file with ANSI (FORTRAN) carriage control. 

dvi, a DVI file produced by TeX or LaTeX 

ps, a PostScript file 

di, a Ditroff output file 


 

 

-holes [yes | no]  Specifies whether you want your printout to be hole-punched like notebook paper. Default is no.   yes, gives you holes 
no, without holes (the default)
-duplex [yes | no] Specifies whether you want your printout on both sides of the page.  Default is yes for printers which support this option, and no for printers which do not. yes, print on both sides 
no, print on only one side
-staple [yes | no | front | back | both] Specifies whether or not to staple the pages together.  This option is only available on the "central-ps" printer.  Default is yes. yes, staple the pages 
no, do not staple the pages 
front, staple in the upper left corner of a portrait job 
back, staple in the upper left corner of a landscape job 
both, staple twice on the left edge of a portrait job, or twice on the top edge of a landscape job.

 
 
 
1. 
At your acme prompt, type "pico .profile". 
 
2. 
This should bring up a screen of incomprehensible stuff. That is ok. You only have to change vi to pico wherever you see it, without changing anything else. You should see a group of lines that look like this: 
      export EDITOR="`whence pico`"

      export FCEDIT="`whence pico`"

      export VISUAL="`whence vi`"

You want to change the third line so the group of lines looks like this: 
      export EDITOR="`whence pico`"

      export FCEDIT="`whence pico`"

      export VISUAL="`whence pico`"

 
3. 
Then log out and log back in. 

There are many reasons for making a new file. In this class, you will write your homework in a new file each week. To do this, you need to know how to create and edit text files.

All files must have a name. You can pick any name you like for the file as long as it is all one "word".

For example:
 
 
hw7hw7 ans {Not OK, there is a space}
hw7_ans {OK, still all one "word"}
hw7.i.love.1311 {Still OK}

When naming a file, DO NOT use certain characters. For instance, some characters like $, &, *, (, and ) have special meanings. As a rule, just use letters, numbers, underscore (_), dash (-), and period (.) to name files.

Acme has many different editors. Some popular ones on UNIX are emacs and vi. Right now, you are going to use pico (Pine Composer) because it is very easy to use and may remind you of other editors you have used be fore. You will learn emacs and vi in a lab in a few weeks, or you can learn them on your own before then.
 
 

  ^g Online help. Note that there is no man page for pico, just the internal help. 
  ^x Exit Pico. It will prompt you to save if your file has been modified. 
  ^o Save file without quitting. 
  ^r Read in a file. 
  ^d Delete the character your cursor is on. 
  ^k Cut a line or marked area. 
  ^u Uncut (paste) last cut text, inserting it at the current cursor position. 
  ^w Search your document for a word or phrase in your document. Use ^W<Enter> to search for the same word or phrase again. 
  ^f move Forward a character. 
  ^b move Backward a character. 
  ^p move to the Previous line. 
  ^n move to the Next line. 
  ^a move to the beginning of the current line. 
  ^e move to the End of the current line. 
  ^v move forward a page of text. 
  ^y move backward a page of text. 

For practice, create a text file using pico. Write a few sentences about what you did over the break (bet you have not done this since second grade!). Use an appropriate filename. To save it, just exit, and it will ask you if you want to save it.
 
 

Email

Email stands for Electronic Mail. There are many different ways to move information on the Internet, and mailing a letter is probably the most common. When you mail a letter, you are doing nothing more than moving a file from one user on one machine to another user, possibly on another machine.

Your GT-account is capable of receiving mail from and sending mail to computers all over the world. Your e-mail address is: gtnum@prism.gatech.edu. You can use many different programs to send and read mail. The standard one on UNIX machines is mail. It does the job, but like many "standard" things, it is not very user friendly. Some of the more commonly used programs are mutt, elm and pine. We are going to show you pine since it is probably the most intuitive of them all. We encourage you to try the other ones.  It handles most of the details for you. You start it up by typing

pine
 
 

This is what pine might look like:

Pine is a menu-driven program.  Notice the area at the bottom that shows you what keys will do what.  You can either use the arrow keys to move the highlighted choice, 'P' and 'N' to move the highlighted choice, or you can type the letter of the menu choice.  Pressing 'L', for example, will take you to the folder listing:

From here you can select INBOX, where the mail you have received will be kept, or sent-mail, where a copy of mail you have sent will be kept.

Above is a sample INBOX with the important fields labeled.  New (unread) mail will have the letter 'N' appearing before the message number.  Messages are numbered sequentially, beginning with 1 (for the first e-mail received).  There are many features available in PINE, and you can learn more about the advanced options through the excellent online help available by pressing the '?' key.  Note also that the menu area at the bottom has changed to give you new choices for this screen.  Pressing 'R', for example, will reply to the selected e-mail.

To compose a message, press 'C', and you'll see something like this:

How to Send Email
 
1. 
a. 
If you want to create a brand new email (not reply to an existing email), press "C" to Compose a message. 
Fill in the email address of the recipient. Use commas with more than one recipient. 
Fill in the subject of the message 
 
 
b. 
If you want to reply to a message, highlight the message while in your inbox screen and press "r". 
 
2. 
In the Cc field, , fill in the email address(s) of anyone that you would like to send a copy to, or hit Enter if you do not want to send a copy to anyone. Use commas with more than one recipient.
 
3. 
Type in your message. You'll notice that this interface is very similar to pico; in fact, pico stands for pine composer!  If you want to read in the contents of a file, use ^r.
 
4. 
When you are finished, press ^X to sent your message.

From here on out you are responsible for checking your mail at least once per day. You are responsible for anything that is mailed to you, and because it is the easiest way for TA's to communicate with all of the students in their sections, you may frequently recieve messages from your TA.
 
 

Newsgroups

Another way that you can communicate with other people anywhere in the world is through "newsgroups". A newsgroup is just a collection of messages about a particular topic, much like an electronic bulletin board. Someone subscribed to a news group can read the newsgroup and everything posted on it. The first field of the newsgroup name tells you what it is about. For instance, all of Georgia Tech's internal newsgroups begin with "git", while worldwide newsgroups for recreational activities start with "rec" and groups for computers start with "comp".
 
 

git.cc.class.cs1311x.announce
important, official announcements 
git.cc.class.cs1311x.homework
questions regarding homeworks or quizzes 
git.cc.class.cs1311x.lab
questions regarding labs 
git.cc.class.cs1311x.questions
questions not about homeworks, quizzes, or labs. 
In order to read newsgroups, you need to use a program called (aptly enough) a newsreader. There are several newsreaders on acme, but the easiest one to use is tin.

 
 
            If, for example, you want to add the newsgroup git.test, you would type
            g git.test
            Tin will ask you where you want to put the new group. This is really asking if you want to see it at the top, bottom, or somewhere in the middle of the list of newsgroups. Typically, you would want it at the top, so press "1" now. After a moment, you should see git.test at the top of the screen.
1 + 4 [hw1-p1] How do you do question 1 George Burdell
  1.  To post a test message, first subscribe to git.test

Do not post a test message to any other newsgroup besides git.test!

  2.  Hit Enter to see the names of the threads in git.test. To post an article that is about a new subject (i.e. it is not a follow-up to someone else's post), type "w". 
  3.  Tin will prompt you for a subject. The subject should be a short, descriptive summary of your post, so the standard subjects for posts to 1311x newsgroups are: 
    [hw#][p#] <subject> 
    [quiz#][p#] <subject> 
    [lab#] <subject>
Follow this rule! 
  4.  Next, tin will place you in your editor. Leave whatever lines you see there, and at least one blank line. Now just write whatever it is you want to say. 
  5.  When you are finished writing, just save the article (do not change the filename or your message will not post) and you will be asked what to do with it. Type "p" to post or "q" to cancel. This will post the article, or give you a simple error message telling you why it could not post. If you get an error message, ask your TA. 
  crosspost post one article to multiple newsgroups. 
  flame an angry tirade sent by someone, designed to insult you and make you angry. 
  flamewar a useless thread where everyone just flames everyone else. This usually stems from touchy issues. 
  forward you get mail from someone and send the mail to others instead of replying to the sender. 
  newbie someone who is new to computers and/or the Internet. 
  sig short for signature, it is the tag line(s) that you save in a file called .signature that are automatically added to end of your emails and newsgroup postings. People usually like to put their name, email, and a short quote in their signatures. 
  spam unsolicited junk email sent in bulk to the masses. They usually have subject lines like "porn XXX" and "make money fast!" or advertise dubious products. 
  troll someone purposely baits netizens with dumb posts so they would flame him. 
  usenet newsgroups. 

 
 
1. 
Do not post test messages to any newsgroup other than a test newsgroup. 
 
2. 
Make sure your sig is equal to or under four lines long, and never, ever include huge ASCII art (picture made with text) in your sig. 
 
3. 
Keep your lines between 65 and 75 characters across. Any more and your text will be wrapped strangely on the standard 80-character newsreaders. (If you are using pico to post in tin, you do not have to worry about this too much. Pico should takes care of line wrapping automatically.) 
 
4. 
Just because you cannot see who you are talking to does not mean you can be mean, insensitive, or rude to them. 
 
5. 
Quote what you are replying to so others know what you are talking about. 
 
6. 
Delete any text that you are not replying to, especially the other person's sig. 
 
7. 
Do not use ALL CAPS. It means shouting and is just as impolite in cyberspace as in real life. To give emphasis, use asterisks *to emphasize* like this. 
 
8. 
Do not write in a shorthand such as "u r cool d00dz!!". Spell correctly, and observe grammar rules. 
 
9. 
Do not repeat other people's posts. 
 
10. 
Refrain from making one-liner replies like "me too" or "I agree". 
 
11. 
Cancel a post instead of replying to it and apologizing for your mistake. Posting something else about your mistake just wastes people's time. 
 
12. 
Change the thread title if the thread has deviated from its original subject. 
 
13. 
Do not crosspost too much. 
 
14. 
Ignore trolls instead of giving in to the urge to flame them. 
 
15. 
Do not send email or post in html format. 
 
16. 
Do not post spam to the newsgroups or send it through email. 

 
 
1. 
Post test messages only to git.test 
 
2. 
For posting in 1311x newsgroups, always use our special subject line format. Refer to Posting Articles in the Tin section if you have forgotten. 
 
3. 
Do not crosspost one question to all the 1311x newsgroups. Post in the appropriate newsgroup. 
 
4. 
Post only if no one has asked your question already. Otherwise, go read the replies. 
 
5. 
TAs are students too. Do not moan and rant if we do not answer your question in ten minutes. We have to study too. During non-sleeping hours, give us three hours to answer your newsgroup posting. 
 
6. 
Start your assignments early. It is not our fault if you wait until two hours before the assignment is due to start asking questions. 
 
7. 
Do not post binary files (pictures, programs, music files, etc.) to our newsgroups. 
 
8. 
Do not whine to 1311x newsgroups! Whine to git.cc.class.150x 

 

Your Assignment

We introduced a lot of important information in this lab, so now we must make sure you have absorbed it.

  1.  Get the lab1 file here
  2.  Answer the questions in an e-mail in the following format :

[1] T
[2] T
.
.
.
[10] T

Use the '^O' command to pOstpone your message until later.  Quit pine with the 'q' command.

  3.  Edit the default signature to make it your own. Use the command "pico ~/.signature". Remember to follow netiquette and not create a signature that is more than four lines long. 
  4.  You must use your gt-account to post to git.test. The subject must be "[CS1311X]_LAB_ONE" (not including the quotation marks, in all caps, including the underscores), and the body of the post must contain your name, gt-number, sig, and some kind of "hi" message.  If you do not follow these directions, we will not be able to give you this half of your lab grade. 

Do NOT post it to any of the git.cc.class.cs1311x newsgroups! You will not receive credit if you do. 

  5.  Reopen pine, and say yes when it askes you if you want to continue the postponed message.  Address it to cs1311x@r42h122.res.gatech.edu with the subject "LAB_ONE"(not including the quotation marks and including the underscore). If you correctly answer the questions and e-mail them in the correct format, you will get the first half of the available points for this lab. 

Notes: 

    The subject line should be all capital letters. 
    If you send it from any account other than your gt-account, it will be ignored. 
    Be sure to fill out everything as specified in the assignment.
    You should get an e-mailed response within ten minutes telling you how well you did.  You may submit as many e-mails as you like, but only the grade for the last message will count for this portion of your grade. IMPORTANT:If you do not post correctly to git.test, you must resend your quiz again AFTER you have reposted correctly. If you post correctly but do not mail, then you will get a ZERO for the newsgroup posting half of this lab.