VI COPY FILE TO FILE

Here is how to copy the required number of lines from one file to another in VI editor.  First
use the following key combinations in the source file.

Press ESCAPE

Press Shift “(Shift double quotes)

Press a

Press the number of lines you want to copy

press y followed by another y

 

Now press ” : ” (COLON) to get the vi prompt.

Hit e “Destination file name”

Once you enter the Destination file

go to the line where you want the lines

copied to be inserted.

 

Press ESCAPE.

Press SHIFT “(Double quotes).

Press a.

Press p.

 

The lines get copied.

About the Author

Yogi

21 years of experience in various layers of software. Primarily experienced in system side software design and development on server management software. Interested in linux development in x86 and arm architecture.