website design, maintenance, and hosting

Beginning UNIX Tutorial


UNIX is an operating system just like DOS, OS/2, and Macintosh OS are operating systems. UNIX differs from other operating systems in that it is more efficient at handling multiple users. Unfortunately, UNIX is not quite as user friendly as a Macintosh computer so you have to spend a little time learning seemingly cryptic commands. Have no worries though, in a matter of hours, after working through this tutorial, you'll be jamming away in UNIX.


Logging into a UNIX machine:

First you're going to need to log into one of our machines. To do this you will need a telnet program. In Windows95/NT you will have the ability to use the simple telnet command provided with your operating system. If you are using a Macintosh you will need to obtain the program NCSA Telnet.

Things you are going to need to know

  1. The account name you chose upon ordering your account.
  2. The server name to which your account is located.
  3. The password for the account of which you should have received in an email sent to you when you opened your account with us.

Logging on and off from a Windows95/NT
  1. Click on the Start Menu.
  2. Once the Start Menu is open click on Run.
  3. A box will appear prompting you to enter what command you would like to run.$
  4. In the box enter:

    telnet server.he.net

    where server is the machine to which your account is located on. An example of this would be:

    mars.he.net

    or just

    he.net

    Hit return when you are done typing.

  5. From this point you will shortly be prompted for Login: and Password:.
  6. At the login and password prompts, enter your account name and password.
  7. At this point you should be at the shell prompt. It should look something like:

    mars:~$

  8. When you're finished , type exit to end your session.
  9. Close the telnet window and you're done.

Logging on and off from a Macintosh

  1. Install NCSA Telnet if it's not already installed.
  2. After installing NCSA Telnet locate where it was installed.
  3. Double click the NCSA Telnet folder icon.
  4. Double click the Telnet MacTCP icon.
  5. A screen will appear with the NCSA logo. When that has disappeared:
  6. Pull down the File menu and select Open Connection.
  7. A dialog box will appear. In the Session name: box, type

    server.he.net

    where server is the machine to which your account is located on. An example of this would be:

    mars.he.net

    or just

    he.net

    When finished Click the box marked OK.

  8. In the box enter:

    telnet server.he.net

    where server is the machine to which your account is located on. An example of this would be:

    mars.he.net

    or just

    he.net

    Hit return when you are done typing.

  9. Type your username and password when prompted.
  10. Now you will be logged on to the UNIX system.
  11. When you are finished , type:

    exit

    to end your session.

  12. To exit NCSA Telnet, pull down the File menu and select Quit.


UNIX Files:
Since most of what we do on computers involves working with a computer file we'll spend a minute talking about how UNIX organizes files. The file system is organized in a hierarchical fashion like the branches on an inverted tree. These branches are called directories. Each user has a personal home directory. When you log in to your account you will automatically be in your home directory. You can find out what directory you are in by typing the command pwd. For example type pwd in your shell tool window and you will see something like:

he:~$ pwd

/home/jdoe/

You can use this command to determine what directory you are in. But your prompt 'he:~$' will also notify you of what directory you are working in. If your prompt shows a ~ symbol that means you are somewhere under your home directory tree. ~ = home directory(/home/youraccount/). So ~/public_html = /home/youraccount/public_html. Watching your pathname will aid you in navigating your way around directories in UNIX.

The rest of this tutorial is designed to teach you the basic UNIX commands you will need to know in order to survive while working on your account. The best way to learn is by doing so each command will be followed by a short exercise in using it.


UNIX Commands


Listing the files in a directory: ls

If you type ls you will see a list of files in your directory. So, type ls in your shell window and hit return. Chances are you will not see anything since your directory is empty. However, there are some files hidden in your directory that do not appear since they most likely not need to be changed (they are for 'administrative' purposes).

Here are a few recommended options you should try with ls:

ls -a

- shows you all the files in your directory, including hidden ones.

ls -l

- shows you the files in your directory in long format. Giving you the ability to see file persmissions, owner of file, creation date, and filename.

ls -al

- combination of the two above.

ls -sF

- lists files in standard format with a number to the left of the name this number is the size of the file in blocks -- 1 block = 1024 bytes. So 28 blocks would equal about 28k. The 'F' in ls -sF allows directorys to be destinguised from files in that they will appear with a slash(/) at the end of their name.

It is recommended you try and use ls -l at most times to easily fammiliarize yourself with the files you are working with.


Copying a file: cp

Here is a quick list of things you will need to do in order to get a quick idea how the cp command works.
- Log into the server to which your account is setup on.
- Create a dummy text file to test copying around.

Once you get to the shell prompt:

server:~$

you will need to type the following commands in order to create your dummy text file. Enter a return after each line, once you finished typing 'this is a text file' hold down your control key and press c.

cat > test.txt
this is a text file

Once you have created your file to test with you can start testing the cp command to see how files are copied around.
Try the following commands:

ls -l
cp test.txt test.txt.backupBR> ls -l

Once you are finished you will have created a file called test.txt.backup it will be an identical copy of the original file.


Looking at a file: more or cat

There are two UNIX commands that allow you to look at a file they are:

more

and

cat

If you want an entire file to dump to your screen at once type:

cat test.txt

You can now see what was in the file junk that you copied. Now type:

cat test.txt.backup

Now you can see that you successfully copied the file test.txt to the file test.txt.backup.

The second way to look at a file, more, is better if a file is longer than the window you are going to look at it in. The more command allows you to scroll down through a document one screen full at a time. You probably do not have a file bigger than one page in your directory so for the time being type:

more test.txt


Removing (deleting) a file: rm

This command is used to permanently delete a file. To delete the file you created in the previous command summary for cp type:

rm test.txt.backup

To help conserve on disc storage space please be sure to delete files that are unnecessary.


Making a directory to organize files: mkdir

The command mkdir creates a new directory. You will find it useful to make a new directories to organize your files. So, to make a directory for this tutorial, which you will put some files in later, type:

mkdir temp

Now type ls -l and you will see the new directory temp. Now type:

cp test.txt temp

to copy your file test.txt to your new directory named temp. Notice that if you type ls -l, the file test.txt still exists in your home directory. The copy command leaves the original file in intact.


Changing directories: cd

To change to temp, the directory you just created, type:

cd temp

Now type ls -l to make sure that your file test.txt was copied to this directory. To move back one directory, to your home directory in this case, type:

cd ..

Suppose you have created several directories within directories and you want to quickly go back to you home directory without having to type cd .. several times. If you type:

cd

you will automatically move back to your home directory from where ever you are.


Moving files from one directory to another: mv

You should now be in your home directory. Type pwd to make sure. The mv command has a couple uses. You can move a file from one directory to another (without leaving a copy of the original file in the first directory, like the cp command does) or you can change the name of the file. To use this command to rename your file test.txt to a new name, test.html, type:

mv test.txt test.html

Now type ls -l to make sure the file test.txt has been replaced with the file test.html. Also, type 'more test.html' to verify that test.html is the same as test.txt was. To move the file test.html to your new directory temp type:

mv test.html temp

Go to your directory temp and type ls -l to make sure that test.html is in there.


Editing a file: pico

If you want to edit a file you need to use the text editor program and load the file into it. To edit the file test.html type:

pico text.html

Now that you have the file test.html in your text editor, make some changes to the file -- add another line with the contents:

this file has been edited by pico.

Once you are done typing that line you will need to hold down the control key and press O (Control-O to save) and then hold down the control key and press X (Control-X to quit). You should now be out of pico and back at the UNIX prompt.

Type:

more text.html

at your shell prompt to verify that your changes were correctly saved.


Changing your password: passwd

Odds are that the password you were assigned is rather peculiar and cumbersome. To change your password to something that you can more easily remember type:

passwd

and follow the UNIX prompts. Note: security is an important issue on UNIX machines because hackers love to break into systems and crash them. To avoid this problem please take care to do the following with your password:

  1. Never tell anyone what your password is.

  2. Under no conditions email someone your password.

  3. When you select a new password make it at least 6 characters long and include 2 numbers in the password. For example: ru4fun2 would be an acceptable password.


Sending email: pine

Pine is software for sending, receiving, and organizing electronic mail. It is easier to use than the standard UNIX mail reader because it offers on-screen menus and help. This help-file provides basic directions for using Pine. Other advanced features that can be learned through Pine's "Help" menu.

Starting Pine

  1. Logon to your UNIX account.
  2. Type:

    pine

    and press return at the % prompt to start Pine.

Note: Pine has a menu system to help you with commands. The ^ means "control." Therefore, ^C means you should press control and c together.

Sending Email

  1. Type:

    c

    (for compose) at Pine's Main Menu.

  2. Type the e-mail address of the person you are writing to in the To: field. Press return.
    Note: The next three steps are optional. You may press return at any of the fields that are not applicable.
  3. Type the address of anyone you want to send a copy to in the Cc: field. Press return. When sending a copy to more than one person, make sure and leave a comma between each of the addresses.
  4. Type the name of your file attachment in the Attachment: field. Press return. (For more information about attachments, see the Sending Files section.)
  5. Type the subject of your letter in the Subject: field. Press return.
  6. Type your message below the Message Text Line. You need only press return between paragraphs as pine will automatically wrap Lines for you.
  7. Press: CNTRL-X

    to send the message. A prompt will appear asking if you want to send the message.

  8. Type

    y

    (for yes) to send it; a message will appear indicating that the message is being sent. You will then return to the Main Menu. Or type n (for no) to continue editing the message.

Reading Email

  1. Type:

    i

    at the Main Menu to display an index of the mail in your current mail folder.

  2. HighLIght the message you want to read. You can move the highLIght bar up or down by typing either:

    p

    (previous) or

    n

    (next) or using the up or down arrows.

  3. Type

    v

    or press return to read the highLIghted message. Other pages can be read by pressing the space bar (next page) or - (previous page). Type i to return the Mail Index.

Marking Messages For Deletion
To delete a message you are currently viewing:

  1. Type:

    d

    to mark the message for deletion. The message disappears and the next message in the Mail Index will be displayed (unless the message was the last message in the List).

To delete a message in the mail index:

  1. Type:

    p

    or

    n

    (up or down arrow) to highLIght the message you want to delete.

  2. Type

    d

    to mark the message.

In the Mail Index, you will see a D in the left column next to any messages marked for deletion. You can mark more than one message to be deleted. You will be asked to confirm message deletion when you quit Pine.

Unmarking Messages For Deletion

  1. Type:

    i

    to display the Mail Index.

  2. Type:

    p

    or

    n

    (up or down arrow) to highlight the message you want to unmark.

  3. Type:

    u

    to unmark the message for deletion.

The D next to the message in the Mail Index will disappear and a message will be displayed indicating it will no longer be deleted.

Postponing a Message

  1. Press:

    CTRL-O.

    The mail message you are currently working on will be closed temporarily and saved for later editing. You will be returned to the Main Menu.
    Note: Only one message can be postponed at a time.

  2. Type:

    c when you are ready to edit the postponed message again. A prompt will be displayed asking if you want to "continue the postponed composition".

  3. Type

    y

    (for yes) if you want to edit the postponed message or n (for no) to compose a new letter.

Quitting Pine

  1. Type:

    m to go to the Main Menu.

  2. Type: q

    to quit Pine. A prompt will be displayed asking if you really want to quit.

  3. Type:

    y

    to return to the % prompt or type n to remain in Pine.

  4. If you marked messages for deletion, you will be asked if you wish to expunge the deleted messages before leaving. Type:

    y

    to delete marked messages or type:

    n

    if you don't want the marked messages deleted.


UNIX help manual: man

The man command calls up the UNIX on line help manual. This command provides a lengthy description of a specified UNIX command. To activate this command type "man Unix_command." For example type:

man ls

or to find out more about the man command type:

man man


Logging out of the shell: exit

Exit is used to log off the system and end your current session. When you are ready to leave your telnet session type:

exit

Once you're done you should get disconnected and you can now close your telnet program.


This completes the beginning UNIX tutorial. Several books are available at the bookstore that provide more in-depth explanations of UNIX and its capabilities. If you are really serious about learning UNIX I suggest picking up a book, or two (for cross referencing), on UNIX so you can use this complicated operating system to your advantage.

I have found the following book rather useful on several occasions:
UNIX for Dummies by Levine and Young

A couple other UNIX tutorials on the Web are

http://www.mcsr.olemiss.edu/unixhelp/

http://www.ecn.purdue.edu/ecn/FAQ/unix/




Have You Seen Me?Call 1-800-THE-LOST if you've seen this child. Click on the image for case details. We support the work of the National Center for Missing and Exploited Children.
Click Here To Add A Missing Child Link To Your Pages!


Back To Web Account Documentation.

 

e-mail

Send E-Mail to:
comments@dss-sites.com

http://www.dss-sites.com

Dealer Support Services
203 Pine Street
Fulton, NY 13069-2429
Phone: (315) 598-8082
Fax: (315) 422-3837