Question: Lab 5 Using VI Complete the following exercises, making sure to follow the instructions carefully. Dont forget to put your name in the top right-hand

Lab 5 Using VI

Complete the following exercises, making sure to follow the instructions carefully. Dont forget to put your name in the top right-hand corner of this document and rename the file to Lab5-Lastname, using your last name instead of lastname, before submitting via Blackboard.

Exercise 5-1

  1. Create a new file in vi by issuing the command vi atextfile.
  2. Press the i key on your keyboard to enter insert mode. A message should appear at the bottom of the screen informing you that you have successfully entered insert mode.
  3. Type the following line (without quotes) in the first line and hit enter: Computers are useless
  4. Press the esc key on your keyboard to exit insert mode and re-enter command mode.
  5. Type :w and then hit enter to write, or save, the file. You should receive a message at the bottom of the screen informing you that you were successful.
  6. Type i to enter insert mode again. Add a second line (without qoutes) to the file which says: , they can only give you answers., and a third line (without quotes) that says -Pablo Picasso.
  7. Press escape to enter command mode, then move your cursor to the first line and press capital J. What happened? ___________________________________________
  8. Press u. What happens? __________________________________________________
  9. Press Ctrl+r. What happens? _______________________________________________
  10. Type :w anothertextfile.txt. What did this command do? _______________________________________________________________________
  11. Press i to enter insert mode again. Add a new line to the file that says (without quotes), Neat, huh?
  12. Press the esc key on your keyboard to exit insert mode and re-enter command mode.
  13. Type :q to quit. What happened? ___________________________________________
  14. Type :q!. What happened? ________________________________________________
  15. Was the last line, entered in step 11, saved? Why or why not? ______________________________________________________________________
  16. Make sure to upload the two files created during this exercise when submitting this assignment on BlackBoard.

Exercise 5-2

Describe what each of the following commands do from the command mode of vi:

x __________________________________________________________ 14x __________________________________________________________

A __________________________________________________________ dw __________________________________________________________ 6dw __________________________________________________________ dd __________________________________________________________ 3dd __________________________________________________________ D __________________________________________________________

G __________________________________________________________ 4G __________________________________________________________

J __________________________________________________________ u __________________________________________________________

:w __________________________________________________________ :q __________________________________________________________

:q! __________________________________________________________ :wq __________________________________________________________

:I __________________________________________________________

Exercise 5-3

Describe the two modes of vi, how they are entered/exited from, and what they are for.

__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!