Lab 1: File Systems, Unix and Web Pages

due 11:59 PM September 30


Sun Sep 25 11:16:32 EDT 2011

By the end of this lab, you will be able to:

There are 7 parts to this lab:

Part 1: Introduction
Part 2: Operating Systems
Part 3: File Systems
Part 4: Using Unix
Part 5: Moving Files
Part 6: Starting Your Web Page
Part 7: Submitting Your Work
In this lab, we will highlight instructions for what you have to submit in a yellow box like this one.

Part 1: Introduction

Welcome to the first lab for COS 109. In the next few hours, you'll learn how to explore and find things in the file system on your machine, how to use Unix to run programs, and how to transfer files from your machine to Unix and back. You'll also get started on your own web page. At the end, you'll be asked to submit answers to some questions that will be asked along the way.

You can do this lab in a cluster in the Friend Center, where the machines run Windows 7 and/or Mac OS X and have a specific set of programs loaded. Or you can do it elsewhere, including in your room with your own computer, so long as you are running some flavor of Windows or Mac OS X. If you are not at a lab session, however, you won't be able to ask questions of the lab TAs: when things don't work or when you get into trouble and can't figure out what's wrong, you're on your own.  You are welcome to bring your own laptop to a lab session to get help.   In particular, if you are running a different version of Windows or Mac OS and the instructions don't seem to fit, the lab assistants can help.

We realize that for many of you, much of this lab will seem incredibly familiar and trivial, but for others, some or even all of it will be new. If you don't know much about computing, follow the steps in order and ask a TA for assistance at any time.

Since software and hardware change every year, often in subtle ways, inevitably something won't work exactly as described here. In particular, last year Windows cluster machines were updated to Windows 7, and new Macs are running version 10.7 ("Lion") of Mac OS X. It is hard to catch all the little differences and to spell out the steps as clearly as we would like. If you find something wrong with the instructions, the lab TAs should be able to help. If not, do what you can and don't worry about it. In any case, please let us know. Thanks.


Part 2: Operating Systems

Windows, Mac OS X, and Unix are all operating systems, which are programs that manage the resources of a computer for you. An operating system lets you run programs like browsers and word processors and iTunes; it lets you access information on disks; it lets you use attached devices like printers and scanners; and it lets you communicate with other machines via a network.

"Windows" is a family of operating systems from Microsoft. Microsoft cranks out a new version every few years: Windows XP has been around since 2001, Vista arrived in 2006, and Windows 7 in 2010. Lion, the latest version of Mac OS, arrived in July 2011. Unix and Linux are also operating systems, not from Microsoft or Apple, that run on a wide variety of hardware, including phones, tablets and e-book readers. All operating systems perform the same basic functions, though with myriad differences in style, philosophy, and details.

One of the main functions of an operating system is to provide an environment in which you can run programs. Operating systems allow you to run several programs at once, switching your attention from one to another at will. Some, like Unix, are mostly controlled by typing on the keyboard. Others are graphical and are mostly controlled with a mouse. Mac OS X has a glossy mouse interface but there's a Unix implementation in the background.

Text Files

Word processing is one of the most frequent computer tasks, and most people have used Microsoft Word to process documents. But there are plenty of times when you don't want a formatted document nor the proprietary Word format. Every system has a variety of editors that let you create plain ASCII text with no additional formatting or other goo.

On Windows, you can use Notepad or Textpad, or you can use Wordpad if you save your files as ".txt" format. You can find these programs from the Start menu in places like All Programs | Accessories or All Programs | Basic Applications. We strongly advise against using Word for text files.

On a Mac, you can use TextEdit (in Go | Applications). Unfortunately TextEdit is sometimes too smart for its own good. Use Preferences | New Document to set "Plain Text". Do not use "rich text format" (.rtf). Under Open and Save, uncheck the box that says "Add '.txt' extension to plain text files". Then when you save lab1.txt and (later on) lab1.html, they will be stored as plain text.

For the rest of this lab, you will record your work in a plain ASCII text file as you go along, then submit it at the end.

Getting Started

Do this to begin collecting data for submission:

  • Type a line with your name and netid.
  • Type a second line naming the operating system and version you are using for this lab (e.g., Windows 7 or Mac OS X 10.6 or whatever).
  • Save the document as a file named lab1.txt.

If you are using a cluster machine, you should save the file on your Desktop, which is really stored on a machine at OIT. If you're on your own machine, save it anywhere convenient.

Leave your editor running. You will be adding content to this file for the rest of the lab. Each time you add something, save the file; this (usually) protects you in case something goes awry, and is always a good idea.


Part 3: File Systems

A file system is a part of the operating system that manages all the data stored on the computer, in a form that is convenient for users to save information, organize it, and retrieve it as needed. The same organizing structures that are useful for the information on a hard disk are also useful for removable media like USB drives, DVDs and music players, and even for information physically stored on other computers and accessed through a network, so these are packaged as file systems as well. Although the physical structures vary greatly, the operating system makes them all look the same to users, an example of implementing the same logical organization with different physical mechanisms.

Information in a file system is organized hierarchically: at the top level is a set of folders (often equivalently called directories) and files. A folder contains the names of files and folders that are grouped together for some purpose. A file holds specific information, such as a Word document, a spreadsheet, a mail message, a picture, a song, or a program like Word or TextEdit.

On Windows, the usual organization creates a file system on the computer's hard drive, in a folder called (for ancient historical reasons) "C:". If there is a CD-ROM or DVD, it takes the next letter, and is thus often "D:". Other plug-in devices take up the next free letters, so if you plug in a USB drive, it will probably be called "E:".

Other "drives", like network connections, have even more arbitrary letter names; at Princeton, student files can be stored in a big file system on a central OIT computer and your part of that file system is accessible from a PC or Mac as your "H:" (for "home") drive. On cluster machines, this should already be set up for you; for instance, on Windows 7 the Personal Files icon accesses your H: drive, and on Mac OS X, there's a disk icon labeled with your netid that leads to your H: drive.

For your own computer, this OIT page explains how to make your part of the OIT Unix file system visible on a Windows PC, and this OIT page explains how to make your part of the OIT Unix file system visible on a Mac.

There are a variety of way to explore the contents of these file systems. The simplest, though not the most flexible, is to double-click on something and see what happens. If you double-click on a folder, it will list whatever is contained therein: each double-click on a folder expands its contents.

A double-click on a file, however, typically executes a program that is associated with the presumed type of information that the file contains, as indicated by the suffix of the name. For instance, filenames ending in .doc are assumed to be Word files, and clicking on such a file will cause Word to be started up to process that file. Filenames ending in .txt are usually associated with Notepad or TextEdit, so another way to start an editor is to click on a file like lab1.txt. You should be cautious about this mechanism if you don't know what you're doing, however. Files of type .exe on Windows are "executable" files -- programs that do something -- and you don't want to run them unless you know exactly what will happen.

Although a Mac .app is actually a folder, double-clicking on it runs the executable program hidden within, so the same cautions apply.

Now do one of the two sections below according to the operating system you're using.

For Windows people: Using Windows Explorer

You can look through folders and find files with your personal folder icon reachable from the Start menu (or My Computer on older versions of Windows) and the Save (and Save As... or Open) dialog box. If you want to move files around or find a program and start it, however, then Windows Explorer (not to be confused with the Internet Explorer browser) is convenient.

Use the Start Menu to find and start Windows Explorer; it will usually be under Programs or All Programs | Accessories. (It is an icon on the task bar on the cluster machines.)

Explorer gives a split-screen view of the file system. To the left is a folder hierarchy. When you click on a folder, its contents will be displayed on the right. Notice that some folders have  little triangles (Vista, Windows 7) or +'s or -'s (XP) next to them. This means that the folder has subfolders. By clicking on the + or - or triangles, you can flip between the condensed view and the expanded view.

Find the file lab1.txt by clicking "Desktop".

You should see all of the Desktop contents displayed at the right, including your file if you saved it there. (The names will roughly correspond to what you actually see on the Windows Desktop.)  Now look through the menus at the top.  If you are using Vista or Windows 7, push the Alt key to get a second menu above the original; this menu is available in XP's "Edit" menu. Try left-clicking and right-clicking "File", "Edit", "View", "Tools" and "Help" on this upper menu to see what options are available. Don't choose any of these options yet! To move a file, click on it once, then drag it to its new location on the left. You can also right-click on it and select "Cut" to remove it completely, or "Copy" to make a copy of it. Then you can click on a different folder and select "Paste" to put the copy there.

The various programs for displaying directories normally give an almost worthless visual display of icons. You can see much more useful information by selecting View from the menu, then Details. (In Windows 7, view is also an icon below the Search Desktop bar at the upper right.) You can also sort the items in order by date or size or type, either by selecting View, then Arrange Icons, or by clicking on the corresponding column heading. Experiment with them to see what happens.

In spite of its name, Explorer is most useful when you already know approximately where you're going in the file system. If you know even part of the name of a folder or file, however, you can often find it most easily with a different program: Search. Unfortunately, the ways to access Search have changed with each version of Windows. Consider searching C: (Cluster_HD) for all files containing ".exe" in their names. In Windows 7, open Start, then double-click Computer. When the computer window opens, double-click the "C:" icon and enter "name:.exe" in the Search box at the upper right. For Vista, use Start | Search | Advanced Search, check the "include non-indexed...files" option, then set Name to .exe and Location to Cluster_HD (C:). Or you can just type name:.exe in the search box on the Start menu, then click "Search Everywhere" to bring up a search window; then select Advanced. For XP, select Start, then Search, then "For Files or Folders...".

You are now going to try to find some interesting files (and some boring ones too, but that's life). Do the following operations.

Find out the full real name of the folder that holds your file lab1.txt and enter it in lab1.txt on a single line. (You might find even find multiple versions in the automatic backup system; give us one name.) If you are using a computer in a public cluster, starting from Start, search in the folder with your name on it (in the right column of the start window).

As mentioned above, executable programs are stored in files whose names end in .exe. Find all files on the C: drive or Cluster_HD whose names contain the sequence ".exe". How many are there? Add a line to lab1.txt with the number of such files. (The list may include some names that contain "exe" but are not executable .exe files, and it may include folders that happen to contain "exe". Just include those in the total; it's too hard to separate them out.)

Find the executable file for some major application program that you might use, like Excel or Firefox. The best place to look is in Program Files if you didn't see it in the list above. (Vista reveals the size when you mouse over the name or click on it; XP and Windows 7 include a size column.) Add one line with the full name (that is, the name including all of the folders above it) of that file and its size as reported by the system.

Save each time, so in case something bad happens, you still have the information.

At the end of this part you should have 5 lines in lab1.txt.

For Mac people: Using Finder

If you double-click on the icon for a hard drive (HD) or the icon for any folder, you will be displaying the contents using Finder, the all-purpose program for exploring the Mac file system.

Finder gives a multi-screen view of the file system that can be formatted as large useless icons (the default), or a list with details, or multiple columns. These alternate views are selected at the top left of the Finder window. Select the multi-column view. To the left is a folder hierarchy. When you click on a folder, its contents will be displayed to the right. Now select the list view. Notice that some folders have right-pointing or down-pointing triangles next to them. This means that the folder has sub-folders, and you can expand or contract the view by clicking on the triangle. If you double-click on a folder, its contents will be displayed in the Finder window.

From the multi-column view of the hard drive, find the file lab1.txt by clicking on Desktop.

You should see all of the Desktop contents displayed at the right, including your file. (These should correspond to what you actually see on the Desktop, except hard drive icons may be missing on a cluster machine.) Now look through the menus at the top and try clicking on various things to see what options are available. Don't choose any of these options yet! To move a file, click on it and drag it to its new location on the left. You can also click on it and select File / Move to Trash to remove it completely, or Edit | Copy to make a copy of it. Then you can click on a different folder and select Edit | Paste to put the copy there. Some of these options are also available if you right-click on the file (or equivalently Cntl-click, that is, click while pressing the Control key -- good for a one-button mouse).

As mentioned above, a Mac .app is really a folder, with an executable file several levels down. As an experiment, right-click on the name of an application (reached by Finder | Applications),  then Show Package Contents to expand the folder; look in Contents and then in MacOS.

Each Finder window has a search box at the top right corner. However to get more search options, select Find from the File menu at the top left of the display. A Finder search window with a set of options will open.
For example, select This Mac, File Name, name, contains and type "image" to find all file whose names contain "image".

You are now going to use Finder search to find some interesting files (and some boring ones too, but that's life). Do the following operations.

The "Desktop" is really a folder in the file system somewhere. Find out the full real name of the folder that holds your file lab1.txt and enter it in lab1.txt on a single line.   (Click on the file once you've found it and select File | Get Info.)

Add a line to lab1.txt with the number of applications that you were able to find on your computer.

Find the executable file for some major application program that you might use, like Word, Excel or iTunes. Add one line with the full name (that is, the name including all of the folders above it) of that file and its size as reported by the system.

Save each time, so in case something bad happens, you still have the information.

At the end of this part you should have 5 lines in lab1.txt.


Part 4: Using Unix

Unix is an operating system; like Windows and Mac OS X; it controls the resources of a computer on your behalf. Unix has been around a lot longer than other systems, and runs on many more different kinds of computers. Many of the Internet and Web services that you use run on Unix machines, and most of the central computing services at Princeton are based on Unix. The web pages that you will create in the next few labs are also stored in files on Unix systems, so it will help you to understand at least the rudiments of how to access and use the campus Unix systems. The Linux operating system is a variant of Unix, so anything you learn about Unix will apply to Linux as well; indeed, you will use OIT's Linux systems for this lab. We will lump Linux and variants under the generic term "Unix", since for our purposes they are all the same.

Mac OS X is also a Unix variant. Although the Mac has an even glitzier graphical interface than Windows, underneath is the full power of Unix, a nice combination. If you're using a Mac, start Terminal (in Applications / Utilities) and all of the Unix commands described here will run the same.

Unix systems are more reliable and secure than Windows (or so it is believed by Unix aficionados) and present programmers with more convenient access to the internals of the machine. As a result, although Windows is dominant in offices and homes, Unix is often used to support infrastructure functions (the back office); familiar sites like Google, Amazon and Yahoo all use Unix or Linux.

Using the Webserver Search at netcraft.com (upper left, "What's that site running?"), find another major web site that uses Unix or Linux. (You might have to do some digging to determine whether a name like BIG-IP is Unix-based or not.) Add a line to lab1.txt with the site name and the name of the specific Unix variant.

Find a major web site (other than microsoft.com or msnbc.com) that doesn't use Unix or Linux. Add a line to lab1.txt with the site name and the operating system name.

(Hint: checking several other well-known sites is a reasonable approach.)

In this part of the lab, you will see how to connect to a Unix computer provided by OIT. You will also see how Unix provides for the permanent storage of your files.

Using PuTTY or SSH

If you are using a public cluster machine, you can't save files on it. The Desktop you see is not stored on the hard drive of the machine at which you are sitting; it is stored in a Unix system run by OIT. Files are stored there, and backed up onto other systems as well so you can recover them in case of a disaster. Similarly, your Princeton email inbox is located on an OIT Unix system, so it can be centrally administered and accessed from any computer on (or off) campus.

Most of the time you can save and retrieve files from the central system without using Unix directly; the Windows or Mac H: folder that you saw earlier gives you most of the access you need. And you can read mail just fine from your own computer or phone.

But sometimes you simply have to get to the place where the information really is. For this, you have to use a program that lets a user on one computer use another computer over a network connection. There are a variety of options. One common choice is a program called SSH, which stands for "Secure Shell". The important word here is "secure" -- information that travels between your machine and the other system is encrypted, so it can't be eavesdropped on by anyone along the way. This is nice if you're exchanging intimate messages with a significant other, and it's even nicer if you're sending your password to the other machine.

Another choice, which is encouraged by OIT on Windows cluster machines, is a program called PuTTY, which does much the same thing. The cluster machines have PuTTY, and you can download it for your own machine from here; use putty.exe for Windows on Intel x86. If you got the standard software distribution, it's already installed. (In spite of its name, PuTTY has nothing to do with Princeton University; it's an open-source program from England.)

On a Mac, you can use the Terminal application to run SSH and access your OIT account.

Follow these instructions to connect to Arizona, which is a group of OIT computers running Linux. We'll just say "Unix" from now on, since things are mostly exactly the same.

Connecting to Unix

Start by opening SSH or PuTTY. This process will be different depending on which program you use and what operating system you have. Instructions for Mac OS X and Windows are provided below. In either case, if you get a message that says something like

The authenticity of host 'arizona.princeton.edu (128.112.128.42)' can't be established.
RSA key fingerprint is ab:62:85:30:20:81:68:a2:7b:df:a2:72:6e:8f:92:a0.
Are you sure you want to continue connecting (yes/no)?
answer yes. You may also be asked whether you want to save the host key to the local database; "no" is fine in all cases, but you can also say "yes" if you're on your own machine.

For Windows users:

Run PuTTY by selecting it from the Start menu. It will likely be listed under "(All) Programs | ..." If that fails, consult a TA.

If there were no problems you will be asked for your password. Enter it at the appropriate time, then push Enter. You can ignore (No or Cancel) anything else that happens first.

Note: Your password may not be echoed with asterisks as is common on PCs and Macs; there may be no response at all. Just type and push Enter when you're done.

For Mac OS X users:

If you are running Mac OS X start the Terminal application, which is Applications | Utilities.

Once you have Terminal running, type the following line:

      	ssh your_netid@arizona.princeton.edu

Replace your_netid with your own netid. For example, if your netid is joesmith, you should type ssh joesmith@arizona.princeton.edu. After you have typed this line, press Enter or Return.  You will be asked for your password.  Enter it at the appropriate time, then push Enter or Return.

Note: Your password may not be echoed with asterisks as is common on PCs and Macs; there may be no response at all. Just type and push Enter when you're done.

Welcome To Unix

You should see a flood of text lines that finally ends with a "prompt" that looks like this:

        flagstaff.Princeton.EDU%
The prompt says that you are now connected to one of the computers in the Arizona cluster (flagstaff, phoenix, tucson or yuma) and it's ready to do your bidding.

Basic Unix Commands

As seen here, Unix has a very different flavor from Windows. Rather than running a program by clicking on an icon or selecting a menu item, you type the name of the program in a window where a prompt is displayed. Keyboard commands with cryptic names like "ls" and "cd" run programs to help you navigate Unix and can be typed in whenever you see a command prompt like

        yuma.Princeton.EDU%

Behind the scenes, Unix, like Windows and Mac OS X, maintains a file system with files and folders (though it calls folders "directories"). When you first log in, you should be in a directory called your "home" directory. This is loosely like C: on Windows or Home on a Mac; it holds all of your files, most of which cannot be read or even seen by other users. And it's the same directory that is set up as the H: drive from a PC or a Mac.

Before you start typing Unix commands, familiarize yourself with the way the commands will be written in these lab instructions. Whenever you are told to type something, what you should type will be in this computer-like font. Similarly you will sometimes have to substitute information of your own; we will use this italic computer-like font, as in your_netid. In all of these, pay attention to case -- Unix distinguishes between lower and upper case letters -- and to spacing.

Note: When logged into UNIX, you may have to use the "DEL" or "Delete" key instead of "Backspace" to delete a character.

Try the following commands. For each, type the command name, then push Enter or Return.

Why use Unix? It largely depends on what task you are trying to accomplish. For example, Windows has an enormous collection of useful programs, many of which have no Unix equivalent, and Windows comes installed on most PC's. Unix is a good environment for writing programs, however, especially programs that are meant to work on more than one kind of computer, so it is often preferred by programmers. It supports a bunch of users on one machine, which Windows does not. Meanwhile, don't worry if Unix seems strange at first. You won't need to use it very often, but it is helpful to know how to move around in it. And if you own a Mac, knowing Unix will give you a new way to use your computer and let you do operations that aren't possible with the point and click interface.

Add a line to lab1.txt telling us which specific OIT cluster machine (Yuma, Flagstaff, ...) you wound up logging in to.

Run the command ls -l on your home Unix directory, and copy the first two lines of the result into lab1.txt by Copy and Paste. (Don't include the line that says "total ..."; it's boring. Copy the next two lines.)

Type the command who | wc. (That character is the vertical bar, not the letter i or ell; it is often above the Enter key and may look like two short dashed lines.) This will tell you how many users are logged into the Unix system (in the first of the three numbers it prints). Add a line to lab1.txt giving the number of users logged in.

At this point, you should have 11 lines in lab1.txt.


Part 5: Transferring Files

You will now return to working within your Windows or Mac operating system. If you are working on your own computer, make sure your H: drive is visible as explained in Part 3.

There are a variety of ways to copy files from one place in a file system to another, or from one file system to another. In Windows, the clearest and most uniform way is to select the file of interest by a single mouse click in a program like Explorer (so it is highlighted), select Copy from the Edit menu or by right-clicking on the filename, then select the folder where you want the copy to appear (so the folder name is highlighted), then select Paste from the Edit menu or by right-clicking.

There are shortcut keyboard actions:  for Copy,  use Ctrl-C or, on a Mac, Command-C, and for Paste use Ctrl-V or, on a Mac, Command-V. Those shortcuts are well worth learning. In some situations you can "drag and drop" the file to make a copy, which is very graphical and intuitive. But be cautious with drag and drop, since in some contexts, it means "copy" and in others it means "move", and these are not the same operation: "move" means to remove the file from the place it was and put it into a new place, leaving you with a single instance, while "copy" leaves you with two instances.

Copy the file lab1.txt that you are building up on the Desktop to your Unix cos109 directory as seen through the H: drive, Personal Files, or the Mac equivalent.

After the file is copied (it should take no time at all) verify that it seems to be correct: the file exists in both places, and it has the same size and sensible modification times.

Somewhat irritatingly, Windows Explorer does not always update the display of a folder when a change is made, or it may put the entry at the end instead of in order. To be sure you have a consistent and up to date display you may need to use View | Refresh. Finder does this better, though it can be slow to notice a change.

Verifying the transfer and moving the file with Unix

Here is a chance for you to use your newfound Unix skill to see if the file was copied correctly.

Connect to Arizona again if you closed the PuTTY/SSH window already. As always when you first log in you will be in your home directory. This is the same directory as your H: drive. In your PuTTY/SSH window type

cd cos109
ls -l
to verify that the file you just transferred is there and about the right size. It should be about the same size as in Desktop. The file size in bytes is the number just before the date.

Add a line to lab1.txt with the size reported by Unix and the size reported by Explorer or Finder (e.g., Unix 395, Windows 1KB).

The last two things that you did, changing to a directory with cd, and listing the contents of the directory with ls, are much the same as double-clicking on a folder. When you double-click you're telling the operating system "I want to move to this directory, and I want to be shown what's in it."

When you're done this part, you can quit PuTTY/SSH if you like; type the command exit or kill the window.


Part 6: Starting your Web Page

A web page is a text document similar to the one you've been creating for this lab, but there are two important differences between lab1.txt and a web page. First, a web page is stored in a specific folder where it is visible on the web. Second, whereas lab1.txt is written so that it's easy for a person to read, a web page is written so that a browser can format it the way you want. With the second condition in mind, let's start making a web page.

Open a new document in your editor and save it as lab1.html. If you're using TextEdit on a Mac, be careful: as noted above, open a blank TextEdit window, set the mode to plain text, then use File | Open to load a file. This should avoid the unwanted conversion to rtf format. (You should also check "Ignore rich text commands in HTML files" under  Preferences | Open and Save to allow you to reopen lab1.html as a text file if you have saved and closed it.)

Web pages are written using a special language called HTML, which stands for HyperText Markup Language. Mostly HTML is ordinary text, but it includes formatting information that describes the layout. This extra information is contained in a set of tags, which are ordinary text surrounded by < and > signs. They give the browser information about how to display the text.

The skeleton of any web page looks like this:

<html>
<head>
<title> Title of the Web Page Goes Here </title>
</head>
<body>
Content of the web page goes here
</body>
</html>

In Lab 2 we will go into detail about what exactly this means, but for the time being it's safe to simply copy this text and paste it into your new document. Remember to save the document every time you make a change.

Once the document is saved as lab1.html, start your web browser of choice. You can preview your page by opening the document which you just saved in the browser, using File | Open. When the Open dialog comes up, navigate to where the file was saved and open it. (You could also double-click on lab1.html in Explorer or Finder.) This will show you exactly how the document will look to other people who visit your page. Right now it isn't very interesting, since it just says "Content of the web page goes here", so next you're going to fix that, by adding content and a title.

Replace "Title of the Web Page Goes Here" by a brief title.

Replace "Content of the web page goes here" by your name.

Test these modifications by loading the page in your browser as described above. You will have to save the file in your editor and then Reload in the browser before you will see the change; don't forget this!

Unlike the Title tags, we put the Body tags on their own lines rather than sharing a line with the content. This illustrates an important point of HTML syntax. The browser doesn't care where you break lines of text while you're writing your page -- it just ignores line breaks. Thus web page designers have to use a special tag to designate where to break lines when the page is displayed. This tag is the <br> tag.

Add a <br> tag after your name, then add four more lines with the following information:
  • The number of lines in your lab1.txt file.
  • The name of the operating system on the where you did the lab computer (e.g., Windows Vista, Windows 7, Mac OS X, etc.).
  • Where you did the lab: "dorm room" or "Friend cluster" or whatever.
  • What browser you used to view the page (e.g., Firefox, Safari, Intenet Explorer, etc.).
  • Use a <br> tag after each line so they appear as separate lines.
  • Test this modification by saving and loading the page in your browser. Each piece of information should appear on its own line, so be careful where you put your <br> tags.

    Sharing Your Page With the World

    Now that you've created your web page, you have to make it available to others. Log in to Arizona if necessary. Copy your newly created lab1.html file into your public_html directory (which should already exist).

    Copying a file from a Mac to your OIT public_html folder is trickier than it ought to be. This OIT page describes several options. It is also possible, and probably easier, to use Unix commands. In a terminal window on your Mac, change to the directory that contains your lab1.html (e.g., cd Desktop) and use the scp (secure copy) command:
         scp lab1.html your_netid@arizona.princeton.edu:public_html/lab1.html

    Once these steps are completed you can test the results by going to

        http://www.princeton.edu/~your_netid/lab1.html

    You may have to change the permissions on your file to let people see it. If your browser tells you that you don't have permission to access the file, log in to Arizona again and type the command

    chmod 755 public_html/lab1.html

    For Windows, an alternative is to right-click lab1.html, select Properties | Security and allow "Read" under "Permissions for Everyone". (You don't want everyone to do anything else to your file.) If you can't access your page or if it doesn't display correctly, ask the TAs for help. This OIT page may also help.


    Part 7: Submitting your work

    At the end of most labs, you will be asked to submit your results by uploading some files to dropbox.cs.princeton.edu. Be sure to include everything we asked for. If you have comments or suggestions, we'd be happy to get those as well.

    Check your work

    Make sure you've done all the steps.

    Make sure your web page is accessible at http://www.princeton.edu/~your_netid/lab1.html. Ask a friend to look at it from his or her browser. If they can see it, so can we; if they can't, we can't.

    Submit your work

    Upload the files lab1.txt (which should now contain 12 lines) and lab1.html to the CS dropbox. If you want to make any additional comments or observations, you can upload another file or add them to the end of lab1.txt.

    Be sure to save your work

    If you are working on a cluster machine, mail the files to yourself as well. This is a good check on whether you really sent the right stuff. Paranoids will make sure that this mail arrives and looks right before they leave the lab or turn off their computer.

    Files on a public computer are routinely erased, so they won't be there for long after you stop using it. This won't matter if you're using your H: drive, as you would normally do, which includes using your cluster Desktop.   If you're working on your own machine, it's wise to back up your work on your H: drive or a flash drive as well. Putting things on a flash drive routinely is a good habit to get into.

    If you've completed the lab, uploaded your files, and made a backup copy of your work, you're all done.