LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Command for copy (https://www.linuxquestions.org/questions/linux-newbie-8/command-for-copy-664791/)

juber 08-23-2008 06:23 AM

Command for copy
 
could you please tell me what are the commands for copy and paste for a particular word or sentence of a line in vi editing mode of a file for Redhat Enterprise v.4. As well what are the commands for Visual Mode.
.....Thank you !

pinniped 08-23-2008 06:33 AM

man vimtutor (have fun learning!)

A copy is a 'yank', so: 12yw = yank 12 words

A paste is P (but not in insert mode)

That's the most basic stuff - play with the tutor to learn more.

varunnarang 08-23-2008 06:34 AM

There's plenty of documentation available on how to use VI editor but graphically and on command line. You might want to Google for some links.
A quick one is below:
http://www.cs.rit.edu/~cslab/vi.html

Hope this would help.

+ Varun.

sica07 08-23-2008 06:41 AM

In visual mode:
-highlight the the text, press d tu cut, y to copy
-move to target location, press P to paste aftercursor or p to paste before the cursor

cmx08 08-23-2008 07:54 AM

vi command copy by row (not in insert mode)

:set number
:a,b y and press p button to paste (before paste u need to point the cursor to the location u want to paste)

a = row start copy (put in number)
b = row end copy (put in number)
y = copy


All times are GMT -5. The time now is 12:13 PM.