Point value: 10
Date due: send email (using mail utility described below) to your
lab instructor by 11:59pm Wed, Sep 6
This exercise is designed to introduce you to
- using the CS computer lab
- changing your CS password
- the Linux cp, more, and cat
- compiling and running a C++
- remote login using ssh
- email a file using mail utility
Change your CS
Compiling and Executing a C++ Program
- Check your Rebelmail for a message
with your CS account information. This account will allow you
to login to the CS Computer lab machines (TBE B361) and the CS
department's remote servers.
- If you did not receive an email
with your CS account information, it is because you already
have a CS account or added the class after new accounts were
- Read the Changing CS Account Password
- Log in to your cs account using
your login name (RebelMail user name) and password.
- If this is the first time you
are logging in, it will be the password in the email.
- If you already have an account,
your password has not expired.
- If you cannot remember your
password, request a password reset at the tux website (see
- Follow the instructions on
the handout describing how to change your password.
- Test your new password.
- Log out of your account.
- Log back in using your new
- The file, exercise01.cpp
is located in the following directory: ~lee/cs135labs.
- Use the following command to copy
the file into your account:
- (you may choose what you want to
call the file, but make sure the name ends with .cpp)
- Use the more or cat command to
look at what is in the file.
- Compile the program with the
command: g++ yourfilename.cpp
- To execute (run) the program,
type: ./a.out (press
Using ssh (in TBE
B361) to login to bobby.cs.unlv.edu
bobby.cs.unlv.edu is the cs department's general purpose
login machine. You can connect to this machine using a program
called ssh from the cs lab (TBE B361) and from home (see
Download/Install SSH section below.)
- In TBE B361, at the system prompt
type: ssh bobby.cs.unlv.edu
- When prompted, type in your cs
password. (It will not be displayed to the screen.)
When you are
connected to bobby, you will be able to access your cs account
files. You MUST login to bobby to use the mail utility
and to submit your programs.
- Read the How to Email Lab Assignments from CS
Servers handout. This handout explains how to email a
- Use the mail utility to email the
program file copied from cs135labs/ to your lab instructor.
- The subject line of the message
MUST contain your name, exercise#, lecture section#, and lab
- The body of the message must
contain your program file.
- The message MUST be sent to your
- It is a good idea to send a
carbon copy of the message to yourself (-c option, shown
-s "your_name, exercise#, lec_sec#, lab_sec#" -c your_email_add
lab_instructor's_email_add < filename
- Make sure you are logged in to bobby.cs.unlv.edu (from home or in
- Use the more or cat command to
verify the content of the file you want to send. Make sure it
compiles and runs.
- At the system prompt, type the
command to email your file to your lab instructor (filename is
the name of the file you created):
mail -s "Mary Smith
Exercise #1 Lec 1001 Lab 1011" -c firstname.lastname@example.org
email@example.com < maryex1.cpp
- Make sure you press Enter after
typing the command.
- For example, if Mary Smith
(RebelMail address is firstname.lastname@example.org) is in lecture
section 1001, lab section 1011 and wants to email her program
file called maryex1.cpp to her lab instructor (email address
email@example.com), then the command would be:
SSH - Remote Login
- Read the Using SSH to Remotely Access
Computer Science Servers handout.
- If you are a Windows user, follow
the instructions to download and install SSH onto your
personal computer (not the lab machine).
- If you are a Mac user, SSH is
pre-installed. Follow the instructions to locate and use it.
- Use SSH to login to
bobby.cs.unlv.edu using your cs login name and new password.
- When you are finished with your
terminal session, make sure you logout (type logout or Ctrl-d
at the command prompt) before closing the terminal window.