LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-23-2008, 06:23 AM   #1
juber
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
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 !
 
Old 08-23-2008, 06:33 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 08-23-2008, 06:34 AM   #3
varunnarang
LQ Newbie
 
Registered: Oct 2004
Location: India
Distribution: RHL 9.0
Posts: 22

Rep: Reputation: 15
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.
 
Old 08-23-2008, 06:41 AM   #4
sica07
Member
 
Registered: May 2008
Distribution: Arch
Posts: 47
Blog Entries: 3

Rep: Reputation: 16
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
 
Old 08-23-2008, 07:54 AM   #5
cmx08
Member
 
Registered: Aug 2008
Location: Malaysia
Distribution: Fedora Core
Posts: 35

Rep: Reputation: 15
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

Last edited by cmx08; 08-23-2008 at 07:55 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy command jkeertir Linux - Newbie 3 05-29-2008 11:26 PM
Copy command yusufs Linux - General 3 10-28-2007 04:16 AM
Copy command yusufs Linux - Newbie 3 10-25-2007 05:58 AM
copy command munna_dude Linux - General 19 06-21-2007 06:57 AM
Help on copy command Nishant Desai Linux - Software 3 09-20-2006 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration