NEXT UP Edit Mode
Next: Answers

Exercises

Identify vi colon commands to perform each of the following actions:

  1. Find the number of the current cursor line within the file.

  2. Delete the current cursor line and the three following lines.

  3. Search backwards from the current cursor position for the closest previous occurrence of the string '8.7'

  4. Delete the last ten lines of the file.

  5. Search forwards through the file from the current cursor line to find the next number in the file with three or more digits.

  6. Delete all the characters on the current line between and including the occurrences of 'aa' and 'zz'.

  7. Replace all occurrences of '&' in the whole file with the word 'and'.

NEXT UP previous
Next: Answers