answersLogoWhite

0


Best Answer

The command 'Y' or 'yy' copies (yanks) one or more lines. To copy one line, two lines, 10 lines, and all lines to the end of the file, respectively:

Y
2Y
10Y
yG

To paste the text contained in the buffer above (uppercase P) or below the current cursor position (lowercase p), respectively:

P
p

It is also possible to yank text within a line. The following commands yank text from the current cursor position to the end of the word and the end of the line, respectively:

yw
y$

The same commands paste the text within a line. Lower case p pastes after the cursor position and upper case P pastes before.

Paste will also work with deleted text, either lines or parts of lines. Be careful not to execute any other commands prior to pasting as this will empty the buffer.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you yank and paste lines in UNIX?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you paste in vi?

You use the 'yank' and 'put' commands. You 'yank' the lines into a buffer (named a - z) and then go to the place where you want to paste or duplicate them, and use the 'put' command to insert them. You can also read entire files or portions of files with the 'r' command to paste contents into other files.


Which command is used copy and paste in vi editor of UNIX?

The 'yank' and 'put' commands are used to copy and paste lines in a file using 'vi'. Each series of lines that are yanked can be put into a named (or unamed) buffer from a to z and then pasted in the appropriate place in the file. To actually do this procedure takes more than a simple answer so it is suggested that you search using a internet search engine for examples of how to do that or use the 'man vi' command to see the exact procedure in 'vi'.


How do you yank and paste lines?

The command 'Y' or 'yy' copies (yanks) one or more lines. To copy one line, two lines, 10 lines, and all lines to the end of the file, respectively: Y 2Y 10Y yG To paste the text contained in the buffer above (uppercase P) or below the current cursor position (lowercase p), respectively: P p It is also possible to yank text within a line. The following commands yank text from the current cursor position to the end of the word and the end of the line, respectively: yw y$ The same commands paste the text within a line. Lower case p pastes after the cursor position and upper case P pastes before. Paste will also work with deleted text, either lines or parts of lines. Be careful not to execute any other commands prior to pasting as this will empty the buffer.


How do you crank a yank on a girl?

You cannot crank a yank on a girl because they have no "crank" to yank.


Which line of OS systems split into two lines only to merge again later?

UNIX and CP/M


Which line of operating systems split into two lines only to merge agine later?

UNIX and CP/M


What is head command in UNIX?

The 'head' command will list out certain number of lines in a file from the beginning. The standard is to list the first 25 lines, but you can change that: head -100 myfile will list out the first 100 lines of myfile.


When was Fighting Yank created?

Fighting Yank was created in 1941.


When was A Yank at Eton created?

A Yank at Eton was created in 1942.


When was Yank Crime created?

Yank Crime was created in 1994.


When was A Yank in Australia created?

A Yank in Australia was created in 1942.


When was A Yank in Ermine created?

A Yank in Ermine was created in 1955.