Summary

Using a text editor is such a fundamental skill that it should be mastered as a UNIX user before attempting to become a Solaris administrator, so we ve only examined the basic operation of vi in this chapter. For more information, read the vi man page.

Questions

1.  

What command is used to perform a forward search for a text string?

  1. /

  2. ?

  3. :

  4. !

 a. / performs a forward search for a text string.

2.  

What command is used to perform a backward search for a text string?

  1. /

  2. ?

  3. :

  4. !

 b. ? performs a backward search for a text string.

3.  

What command is used to run an ex editor command on the current line?

  1. /

  2. ?

  3. :

  4. !

 c. : runs an ex editor command on the current line.

4.  

What command is used to execute a shell within vi?

  1. /

  2. ?

  3. :

  4. !

 d. ! executes a shell within vi.

5.  

What command is used to save a file and exit vi?

  1. ZZ

  2. h

  3. j

  4. k

 a. zz saves a file.

6.  

What command is used to move the cursor left?

  1. ZZ

  2. h

  3. j

  4. k

 b. h moves the cursor left.

7.  

What command is used to move the cursor down?

  1. ZZ

  2. h

  3. j

  4. k

 c. j moves the cursor down.

8.  

What command is used to move the cursor up?

  1. ZZ

  2. h

  3. j

  4. k

 d. k moves the cursor up.

9.  

What command is used to move the cursor to line n ?

  1. :n

  2. :$

  3. :%s/ a/b/ g

  4. :wq

 a. :n ‚moves the cursor to line n.

10.  

What command is used to move the cursor to the end of the file?

  1. :n

  2. :$

  3. :%s/ a/b/ g

  4. :wq

 b. :$ moves the cursor to the end of the file.

11.  

What command is used to replace all occurrences of string a with string b ?

  1. :n

  2. :$

  3. :%s/ a/b/ g

  4. :wq

 c. :%s/ a / b /g replaces all occurrences of string a with string b .

12.  

What command is used to save a modified file and quit?

  1. :n

  2. :$

  3. :%s/ a/b/ g

  4. :wq

 d. :wq saves a modified file and quits.

Answers

1.  

A. / performs a forward search for a text string.

2.  

B. ? performs a backward search for a text string.

3.  

C. : runs an ex editor command on the current line.

4.  

D. ! executes a shell within vi.

5.  

A. ZZ saves a file.

6.  

B. h moves the cursor left.

7.  

C. j moves the cursor down.

8.  

D. k moves the cursor up.

9.  

A. :n ‚moves the cursor to line n.

10.  

B. :$ moves the cursor to the end of the file.

11.  

C. :%s/ a / b /g replaces all occurrences of string a with string b .

12.  

D. :wq saves a modified file and quits.

 
 
   


Sun Certified Solaris 9.0 System and Network Administrator
Sun Certified Solaris(tm) 9 System and Network Administrator All-in-One Exam Guide
ISBN: 0072225300
EAN: 2147483647
Year: 2003
Pages: 265
Authors: Paul Watters

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net