CSCI 220 HTML
Unix and the Internet
No, we're not talking about harem guards
- Unix is an operating system
- O.S.s have three main jobs:
- Dealing with files
- Generating interface between user and system
- Determining overall 'look and feel' of the system
- You may already be familiar with other operating systems
- DOS
- Windows - Win '95
- Macintosh
- Command Line vs. GUI
- Windows and the Mac use Graphic User Interfaces (GUI)
- These interfaces are nice to look at, easy for beginners
- They also demand a lot from the computer
- Earlier machines relied on command line operating systems
- The user has to type commands on an ugly black screen
- Command line systems are harder to use, but can be more
- Powerful in the hands of a skilled user
- The classic example is windows 3.1 and DOS
- (Technically, Win 3.1 is not an OS, but we won't worry about that here)
- Windows is a GUI, DOS is command line
- Although Windows is a much easier system, many experienced computer users
prefer DOS for certain types of work.
- If you know what you're doing, a command line system can be MUCH more
efficient than a GUI
- UNIX as a command line system
- UNIX is at its heart a command line operating system.
- You will see a GUI shell you can use, but you need to know the commands
- There will be times that's the only way you can get around
- If you want to access a UNIX machine from home, you can only do command
line
- History of UNIX
- Multics
- Developed in 1957 (!) by GE, MIT, and Bell labs
- Multi - User
- Time Sharing
- UNIX
- Dennis Ritchie and Ken Thompson modified Multics in 1969
- Named the new operating system UNIX
- Tree - like file structure
- Multi - User
- Multi - tasking
- Current trends
- Many flavors, but all keep same basic ideas
- GUIs are much more popular
- Windows NT is based on Unix, not DOS (!)
- The buzzwords
- Multiuser
- More than one user at a time can use the computer
- An idea borrowed from mainframes
- Multitasking
- One computer can do more than one thing at a time
- Copying a file while running a program and editing a letter
- The entire network of computers shares resources with each other
- The terminal you are sitting at may not actually be doing all
of your work.
- Some of your work may happen on other machines
- Your machine may be doing someone else's work
The most important commands
- cd
- Change Directory
- Unix stores files in a directory tree (like most operating systems)
- The cd command changes to the directory specified
- If you have a directory called mystuff off of the current directory,
you could type
cd mystuff to change to that directory
- Variations
- To change back to a parent directory, type
cd ..
- To change to your home directory, simply type cd
- DOS equivalent:
- Notes
- Directories are separated by forward slashes (/)
- NOT backslashes like DOS.
- Also, unix is case sensitive. MyDir, MYDIR, and mydir are different
- To find out which directory you are in, use the pwd command
- pwd stands for present working directory
- ls
- list
- list current directory
- lists the files and subdirectories of the current directory
- Variations
- ls -l long listing, shows details of files (including permissions)
- There are MANY more, look them up with man
- DOS equivalent:
- Notes
- ls by itself works like a DOS dir /w; it shows the files in columns
- Use ls -l to see the permissions of files, other details
- If your list of files is too long for the screen, you can use ls | more
- mkdir
- Make directory
- Creates a new subdirectory that is a child of the one you are on
- DOS equivalent:
- Notes
- You must give the command a name for the directory
- The name must be one word, is case sensitive
- cd \
- mkdir mystuff
- ..will make a new directory called mystuff from my root directory
- cp
- copy
- copies a file to another file or another directory
- DOS equivalent:
- Notes
- Works just like DOS copy command
cp myfile newfile
- ..will make a copy of myfile and call it newfile
- If I have a directory called mystuff,
cp myfile mystuff
- .. will make a copy of myfile and put it in mystuff
- The ORIGINAL file stays there. cp just make a new version of it
- mv
- move
- moves a file to a new place or renames it
- DOS equivalent:
- RN works like the renaming behavior
- There is no equivalent to the moving behavior
- Notes
- This command works two ways:
mv filename filename
- ..works like a rename in DOS. The file's name is changed
- The original file will be gone.
mv filename directory
- ..actually moves the file into the directory and kills it from
- the original directory
- man
- manual
- DOS equivalent:
- help in ver. 5.0 and later of DOS
- Notes
man topic
- .. opens up the manual page for the topic
- The man pages can be obscure, but they contain a wealth of info
- If man topic didn't work, try man -k topic
- This tells the man engine to search for a keyword
- chmod
- change mode
- Changes the ownership settings of your file or directory
- DOS equivalent:
- None; although FLAG works the same way in Novell
- Notes
- Most of the time, you will leave the default settings alone
- These settings let you do whatever you want to your files
- When you want to make certain things accessible to others,
- you must change the permissions
- You will want to do this for your web documents
- To make a file readable and executable by anyone, use this command
chmod go+rx filename
- where filename is the name of the file or directory you want to
expose
- more on this later...
Lab Assignment
Email and Pine
- Log in to your account
- Type pine (all lowercase) to get to the pine Email program
- There are other programs you can use (elm and mail) but pine is much easier
- When you first log in, pine asks if you want a help sheet. Ask for it.
- Pine is set up with a very easy menu system. Everything you need is there
- Get the Email address of at least one friend in the class
- Enter this address into your address book. (You can figure out how!)
- Send each other mail
- Check to see that the mails made it.
- Our class mailing list
- The class has its own mailing list
- It allows us to easily share information with each other
- We will use it to send announcements to the class
- You can use it to post interesting things you have found, ask your classmates for help, and to generally keep in touch with each other
- To sign up for the list, send an Email to majordomo@klingon.cs.iupui.edu
- Leave the subject header BLANK
- In the message body area, type the following:
subscribe cs220html
- In a few minutes you will get a response from the list server.
- Add this address to your address book:
cs220html@klingon.cs.iupui.edu
- To send a message to the entire group, send it to the cs220html address
- Use proper Email and mailing list etiquette! We are a friendly group here, but you need to learn good habits from the beginning
Your Assignment
- Send an Email to the mailing list introducing yourself to the class. Include:
- Your name
- Your Email address
- What kind of technology, Internet background you have
- What sort of site are you interested in building (ultimate personal page, corporate site, database access, whatever)
- Something else interesting about you that has nothing to do with computers
- (your hobbies, your family, write a sonnet, whatever...)
- Be sure this goes to the MAILING LIST, not just to my personal account.
- Read all these and look for perspective study partners! This is a fascinating group of people!
Setting up your account
- Check which directory you are in (look up the command from above)
- Look at the contents of this directory
- Create a new subdirectory called public_html
- (just like that... with the underscore, all lower case)
- Look again at the contents of the directory, this time using the long switch
- Notice the series of Xs in front of the files
- These refer to permissions
- Note especially the permissions in front of public_html
- Set the permissions of the public_html subdirectory to go+rx
- (That means group and others can read and execute)
- Do another directory listing with the long switch
- Notice that the permissions have changed
- NOTE: If you do not set the permissions properly, I cannot grade your homework!
- Change to the public_html subdirectory
- Check to see that you are in the correct subdirectory
- Use your favorite editor (Pico if you aren't sure) to create a document
Your document
- Make a simple text document that tells me the following things
- Your name
- Your Email address
- Describe in a paragraph or so something you have seen on the net that has impressed you.
- Save the document as myfirst.txt in the public_html subdirectory
Notes
- This is your chance to get used to the editor of your choice. Learn how to copy and paste, the commands for loading and saving, and the on-line help features NOW, so you can use the editor more comfortably later.
- Today, I want you to use one of the unix editors. (There are times that unix is your only option) Later, you may choose to edit in another environment (DOS, Windows, or Mac) and ftp stuff to your unix account. That approach is also fine, but you need to know at least one unix editor
- If in doubt, use pico. It is the editor built into pine. It has menus, and is much easier to use than the others.
- If you want to explore a more powerful editor, explore vi or emacs. They offer many more features than pico, but are harder to use.
- Later when you feel you have outgrown pico, you may want to look up one of these more powerful e ditors
- There is PLENTY of good information and tutorials on these editors available over the net
Places to check for more information:
REQUIRED reading for this lab!
Unix is a four letter word - Great unix reference at Purdue
A nice unix introduction based at UT
A list of links about unix
Good information source on pine email utility
emacs reference source at NWU
Nice vi tutorial at Purdue
© 1996, Andy Harris, Dept. of Computer and Information Science,
Indiana University, Purdue University, Indianapolis
email: aharris@klingon.cs.iupui.edu