Lab (1) - System Security and Administration
Quick Review of vi Editor and Pine E-mail on Linux


In this lab, you will familiar yourself with vi which is a very powerful editor on Linux and Pine which is an e-mail application. These two applications are common on almost all Unix-based machines. It may not be far from fact to say that all system administrators know how to use these two and are using them daily.

Preparations:
Open two screens on student machine and login on both screens.

Activity (1)
Use the vi short manual and go through Step 1 through Step 3 (ends at 3-11). Skip Step 0. This should give you an idea on how vi works.
Once you are done with the Short manual, at the command prompt run: > spell text1 i to make sure you have corrected all the misspelled words.
Open a new file called lab1.txt and answer the following questions in the file. It would be very helpful to learn how to copy from one screen onto the vi editor screen using the left mouse button. You will send a file containing your answers as an e-mail attachement at the end of the lab. At the end of this lab, you will learn how to send e-mails using Pine. For now, just save the file in your directory.

Q1. What is the command that opens a file in vi and starts from a line let's say n. For example, suppose you want to open the text1 file at line 2.

Q2. In vi, how would you delete n characters? For example 10 charters following the curser.

Q3. How do you replace a string with another one in the entire file? For example in the text1 file, how would you replace Unix with Linux in the entire file.

Q4. How would you delete to the beginning of a sentence?

Q5. How would you delete to the end of a sentence?

Q6. How would you search for all occurrences of string "and"? For example, and, standard, slander.

Q7. How would you search for all occurrences of word and? and only.

Q8. What are the differences between the following in vi?
a) i and I
b) a and A
c) o and O
d) r and R
e) u and U

Q9. How would you search backward for a particular string? For example, how would you search for string user when you are the bottom of the file?

Q10. How would you search from line 2 to line 5 for a occurrence of a string?

Activity (2)
Preparations: Open the lab1.txt file and make sure your name is on the first line of that file.
Then, use the Pine manual to send or receive e-mails. At the end send the above file (lab1.txt) as an attachement to me at rt@cs.appstate.edu. Please write on the Subject line: SysAdm Lab (1).