Using the LINUX Labs

 

The LINUX lab is located in the ADM 142 lab.

Logging on to LINUX

 

1.        Turn the monitor and computer on

         

2.     The machines in this lab startup with Boot Manager.   Select the Linux option by using the arrow keys and wait as the machine boots into Linux.

 

3.     At the login prompt    login:

       Type in your login name

       This is, up to the first seven letters of your last name followed by the first letter of your first name.

       Example:  Bill Jefferson     login: jeffersb       Tom Smith       login: smitht

 

4.        Type in your password.
The default is abc123.  You will need to change your password the first time you log in.  Your password needs to be six characters or longer and contain both upper and lower case letters

 

Click on the toolbox icon on the bottom of the screen and select password.  You will now be prompted for your old password and then be asked to enter your new password twice.

 

5.        You should now be logged into the LINUX system.

 

Logging off the system when you are done

 

To log out of LINUX when you are done you should NOT just turn the machine off.

               

Right click on an open area of the desktop and select logout.  The message preparing session for logout appears and a Logout button appears.  Press this button and now click the shutdown button that appears on the next dialog box.  A final dialog appears and you click OK a final time.

 

You will see LINUX shutting down , a blank screen, and then the computer powers down automatically.  At this point turn the power off on the monitor.

=========================================================================================

Using the Online Manual pages (help pages)

 

Type 

             man  vi         for manual pages on the vi editor

         

=========================================================================================

Creating and Editing Text Files

 

        {See  "Using the  vi  Editor section" }

=========================================================================================

Printing Text Files

There is only one printer for each two stations in this lab.  Make sure the power is on, on the printer, the switch is on the right side towards the back.  Check your monitor for the correct switch setting for your machine.  If the printer doesn’t work, try changing the switch to the other position and then back to the correct position.

 

To send a text file to the printer type

 

      lpr filename

 

This will send your text file to the printer.

 

=========================================================================================
Using the mail systems

 

You can use the mail command (icon is on the bottom toolbar) to send or read mail.  You will be mailing me your assignments.

 

Configuring Mail

 

Click the K menu on the far left side of the bottom tool bar.  From the options presented select Internet and then Mail Client.  This will activate the mail client and ask you to fill in some user information.  The first thing it will do is state that it is creating your Mail directory as a folder in user directory.  Click OK and then fill in the following information:

 

Change email address to:                            yourloginname@csc.sdstate.edu

Change Reply-To address to:                yourloginname@csc.sdstate.edu

 

Now click the Network Tab on the top.

 

First click the SMTP button and add an entry for the Server as follows:

   sdsumus.sdstate.edu

 

Now click the Add button near the bottom of the page

 

Click the Pop3 radio button and then click OK

 

On the configure account dialog enter the following information:

 

Name:     Your Name

Login:                YourLoginID

Host:                csc.sdstate.edu

 

Now click OK and you are ready to roll!

 

Using Mail

 

To send and receive mail, start the mail client as above (there is also a button on the toolbar).  There are button icons on the top of the program that can be used to Get Mail and Send Mail. 

 

Clicking Get Mail will prompt you for your password and then retrieve your mail from the mail server.  You may read each message by clicking once and then the text will appear in the lower panel of the mail client.  If you desire you can double click on a message and it will open it in a separate larger window.

 

Click Send Mail will bring up a blank mail message where you will need to fill in the email address of the person you wish to send the mail to.  Please add a subject to the message and then type the message in the window and click the send button when you are ready to send.

 

A signature file is something that can be added to the end of an email message.  To create one us the text editor to create a file with the name .signature and enter your desired information.  You may have multiple files and have the mail client prompt you for which one you wish to use.  If you do not want to use one, press cancel when prompted for a signature.

 

=========================================================================================

Using  mcopy

 

It can be very useful to be able to save your files onto a floppy disk as backup or so that you can take them to another computer.   You could save your program on disk and then go upstairs to print it out using something like windows note-pad or word-pad  programs.

 

To use mcopy you should be logged on to the LINUX system

 

To copy a file to disk:

                                                Type   mcopy  filename  a:

 

To copy a file from disk:

                                                Type  mcopy a:filename  filename

=========================================================================================

To telnet into your account

 

The telnet location is                      csc.sdstate.edu

IP address is                         137.216.209.251

You will need to get any other telnet client other than the one that comes with Microsoft windows.  It does not work correctly with the vi editor.    One freeware client is called TeraTerm which can be downloaded from the wed at sites like

http://cws.internet.com/32menu.html or ask your instructor about getting it off of our Novell lab network.

 

=========================================================================================

Dealing with DOS files under LINUX

 

We have installed a public domain package called mtools, which will allow for some simple DOS file handling.

 

These commands are only used when you are working with the floppy disk in the lab.

 

mcopy  sourcefile  destfile

Copy files to and from the disk

Mdir

List files in dir on disk

Mformat

Formats the disk {careful  this will delete everything from the disk }

man  mtools

If available will bring up man pages for other -m commands

 

=========================================================================================

 

Compiling and running programs:

 

a)       Type g++ programname.C to compile a C++ program with LINUX.

b)       Now type a.out on the command line to run the program.

c)       You may also type the command g++ -o outputfilename programfilename.C

d)       Now you can run the program by typing outputfilename.


Using the  vi   Editor

 

 

 

The  vi  editor is available on every Unix system including LINUX.

 

To enter the editor    type       vi  filename       example:   vi  myfile.C

 

The vi editor has two modes

 

1.        The command mode:  In this mode the characters you type in are used as commands.

2.        The insert mode: In this mode the characters typed in are inserted into the file as text.

 

When you enter the editor you will be in command mode. 

                To enter the insert mode type    i     

               To enter insert at the end of a line so you can append  type    a

To go from insert mode to command mode press the Esc key

 

You may see some lines starting with the  ~  character.   These are just place holder lines that are past the end of your file.

 

All commands must be types while in command mode

 

Commands (not complete list)

 

Screen Movement

Ctrl-U

Scroll Up

Ctrl-D

Scroll Down

Ctrl-F

Scroll Forward

Ctrl-B

Scroll Back

 

Line Movement

j

Move down one line

k

Move up one line

h

Move left one character

l

Move right one character

kG

Go to line k

.

Repeat last edit (change, deletion) command

 

Deletion Commands

dd

Delete current line

ndd

Delete the next  n  lines

nx

Delete next  n characters

D

Delete from current position to end of line

 

Saving, Quitting without Saving and Inserting Files

:w

Save your file

:w file

Save as new file   file

:w! file

Save your file even if it already exists

:wq

Quit and Save

:q!

Quit  but does not save  {important command when you mess up

ZZ

Quit and save    dame as :q but don't have to hit <enter> key

:r file

Insert file at the cursor position

 

Cut and Paste:  To  move text  you first  type  d  followed by any movement command to delete the text.  The last thing you delete is saved in a buffer.    You can use  p  to paste this buffer back into the document.    To copy, first delete the text and paste it right back, then move and paste it again in the new location.

 

For online help on the vi editor:    from outside the editor (ie the command line)  type    man  vi