You must work on this lab individually.
If you are actually enrolled
in CPE 101 (not waitlisted or added) you should have a
computer account that allows you to logon to most of the Computer
Science Department computers. If you are adding the class, we will need
to request an account for you using this form.
This lab helps you login, edit a file, and handin the file. The file you create will be handed in to me electronically in the same manner you will hand in all your labs and programs this quarter.
That being said, you can attempt to log
in following
these
instructions to log on to server named vogon. You
can do so in the Computer Science Lab (CSL) in 14-235 or
from any other computer
with an internet connection running UNIX, Linux, OS-X, or Windows.
Being able to do this from home will increase your level of success in
this class since it will enable you to work when and wherever you want.
If you are using Windows at home you will have to download and install
the SSH client described in the instructions linked above.
If you logged on to a
machine in the lab you are still not quite on vogon. You'll have to
start a terminal and connect to vogon using the command:
ssh vogon
Later, when you are done working on vogon,
you will leave the machine by typing:
exitPart 2: Create a new file using an editor
Once you are successfully logged on to vogon, you will need to create a file from the command line. You should see a prompt that will look something like this:
Now, enter the following command exactly as specified. I have made all of the commands that you are to enter in bold face.
i (command mode) |
switch to insert mode |
Esc (insert mode) |
switch to command mode |
j |
move down |
k |
move up |
h |
move left |
l |
move right |
x |
delete character |
:w |
save file |
:q |
exit vim |
This is my lab 1 file.
This class is CPE 101.
Copy the miles2feet.c and checkit.h files into your directory.
Note that the ~djanzen means in djanzen's home directory, and the . means in the current directory.
Type ls to confirm that two files are now in your directory.
Use vim to edit miles2feet.c. Add a variable miles, use printf and scanf to read a value into miles, then use the function to convert miles to feet and print the result.
Compile your program with the following command:Command |
Usage Example |
Description |
cd |
cd my_dir |
Change to my_directory |
more |
more testfile |
Look at the contents of testfile |
pwd |
pwd |
Show the present working
directory |
ls |
ls |
List the files in the current
directory |
mkdir |
mkdir test |
Make a new directory called
'test' |
rm |
rm testfile |
Delete the file named 'testfile' |
hostname |
hostname |
Show the name of the computer |
exit/logout |
exit |
End the current shell session |