Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-23-2008, 06:23 AM   #1
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
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
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:

Hope this would help.

+ Varun.
Old 08-23-2008, 06:41 AM   #4
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
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:24 PM.

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