If you can see this check that

           prev section up prev page next page

Tutorial 6


The VI editor

User:
Password:

The vi editor.

Question 1: Update demo account

If you have just completed all the previous tutorials you need not use this setup button. However, if you have skipped part or all of the previous tutorial questions, or when you ran your virtual machine the demo account was missing, then the button below will create the demo account and create the files which the previous tutorials would have had you create.

By pressing the button below a new account is created called "demo", password is also "demo". Log in using this account and you cannot do any damage. If you mess the account up and want to start again, just press the button again.

Once created, you can log into this account using telnet or ssh, logging into the hostname linuxzoo.net. Remember the username is demo and the password is demo. And remember, you cannot break anything using this account! The account begins with an empty directory, so dont be shocked that "ls" shows nothing...

Tests - not attempted
Update an account called demo, password demo UNTESTED

Question 2: Enter Text

In the demo account home page, use vi to edit a file called ex1. Insert into this file the following lines.

This is an exercise!
Up, down,
left, right,
build your terminal's
muscles bit by bit

Once edited, you must do a write (:w then return) to write the file so that the checks can find your edits. This is true for ALL the questions in this tutorial.

Tests - not attempted
First line found in ex1 UNTESTED
2nd line found in ex1 UNTESTED
3rd line found in ex1 UNTESTED
4th line found in ex1 UNTESTED
5th line found in ex1 UNTESTED
First edits complete in ex1 UNTESTED

Question 3: Character Changing

Delete the word "an" from the first line, plus one of the spaces. The line left should read "This is exercise!".

Tests - not attempted
line check UNTESTED

Question 4: Appending

Add " and byte by byte" to the end of the line "muscles bit by bit".

Tests - not attempted
line check UNTESTED

Question 5: New file

Create a new file called "ex2". In this file type a number on each line from 1 to 50. Scroll up and down this file. Write the file out to disk.

Tests - not attempted
file is valid UNTESTED

Question 6: ex2 append

Go to the end of the file and Append the following line of text:

123456789 123456789

Tests - not attempted
file is valid UNTESTED

Question 7: Cursor moves

If you are in command mode, what character are you on if you move onto the line of ex2 with "123456789 123456789" and then type

^7l
Note this is HAT (e.g. shift 6) then 7 then the CHARACTER l (not a one).

Tests - not attempted
Effect of ^7l UNTESTED

Question 8: Cursor moves 2

If you are in command mode, what character are you on if you move onto the line of ex2 with "123456789 123456789" and then type

$7h

Tests - not attempted
Effect of $7h UNTESTED

Question 9: File search

Make sure you are in command mode, and move to the first line of ex2. Search forward for the character 8, then search on again, and then once again. What number is written on this line?

Tests - not attempted
Effect of 3 times /8? UNTESTED

Question 10: Create ex3

Create a file using vi called ex3. Insert into this file the following lines.

Append text
Insert text
a computer's
job is boring.

Once edited, you must do a write (:w then return) to write the file so that the checks can find your edits.

Tests - not attempted
First line found in ex3 UNTESTED
2nd line found in ex3 UNTESTED
3th line found in ex3 UNTESTED
4th line found in ex3 UNTESTED
First edits complete in ex3 UNTESTED

Question 11: ex3 pre insert

Add the following line of text ABOVE the first line.

First text

Tests - not attempted
Edit complete in ex3 UNTESTED

Question 12: ex3 post append

Add the following line of text AFTER the last line.

Last text

Tests - not attempted
Edit complete in ex3 UNTESTED

Question 13: ex3 move

Move the line "Last text" to line 2 (i.e. between "First text" and "Append text".

Tests - not attempted
Edit complete in ex3 UNTESTED

Question 14: ex3 edit

Change the last line to read "job was boring" rather than "job is boring".

Tests - not attempted
Edit complete in ex3 UNTESTED


Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net fwall DNS diag Apache1 Apache2
Caine 6.0: Essentials | Basic | Search | SysIntro | 5a | 5b | 5c | 6 | 7a | 7b | 8a | 8b | WebBrowserA | WebBrowserB | Registry | Browser
Digital Investigation: Editing | Email | Logs | Strength
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions
Site Links:XMLZoo ActiveSQL ProgZoo SQLZoo

Copyright @ 2004-2017 Gordon Russell. All rights reserved.