Solaris Advanced User's Guide

Copying Lines

The basic form of the ex copy command is:


:line#,line# co line#

The first two numbers (separated by a comma) specify the range of lines to be copied. The third number is the line before the insertion point.

For example, to copy lines 1 through 5 of paint and place the copy after line 12, you would type the following:


:1,5 co 12

Then press Return.

When you specify line ranges, use the abbreviations:

Thus, to copy the range “from the current line through line 5” and insert this block after line 12, you would type:


:.,5 co 12

To copy the range “from line 6 through the end of the file” and insert this block after line 2, you would type:


:6,$ co 2