LinuxQuestions.org
Review your favorite Linux distribution.
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 04-25-2007, 01:27 PM   #1
smp0219
LQ Newbie
 
Registered: Jan 2007
Posts: 3

Rep: Reputation: 0
How to copy/paste a line in nano editor


Hi,

I am new to using nano editor for editing files. I would like to know how to copy one or more lines of text and paste them elsewhere within the same file.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-25-2007, 01:31 PM   #2
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Move to the beginning of the line, press Ctrl + K and the line will be cut. Then move to the desired position and press Ctrl + U.

nano is rather limited, you may want to use something like gedit, which does allow using a mouse.

Last edited by jay73; 04-25-2007 at 02:12 PM.
 
1 members found this post helpful.
Old 04-25-2007, 02:05 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
There are some more options, but the syntax is non-intuitive. (ctrl-G for all the options)

nano is very handy a fast for simple things....
 
Old 12-08-2008, 03:34 PM   #4
Rotten
LQ Newbie
 
Registered: Dec 2008
Posts: 1

Rep: Reputation: 1
I found this thread and it helped me somewhat. I think what OP wants to do is 'copy' the line, not cut it. Therefore he/she should use 'ALT-6' to copy the current line into the buffer. You can copy as many lines as you like into the buffer, then use 'CTRL-U' to paste those lines. It's a little unintuitive in the NANO help, because for 'CTRL-U' it says 'uncut the line' which to some people actually means undo the last operation. I would prefer if the manual said 'PASTE the line'.

In summary:

'ALT-6' to copy a line (copy as many lines as you like, and they will be pasted in the order you copied them)

'CTRL-U' to paste the lines

Happy Nano-ing!

Last edited by Rotten; 12-08-2008 at 03:35 PM.
 
1 members found this post helpful.
Old 08-25-2009, 06:35 PM   #5
alexander_n
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Rep: Reputation: 2
Select - Copy - Paste

Select: ALT + M + A
Copy: ALT + 6
Paste: CTRL + U


Quote:
Originally Posted by Rotten View Post
I found this thread and it helped me somewhat. I think what OP wants to do is 'copy' the line, not cut it. Therefore he/she should use 'ALT-6' to copy the current line into the buffer. You can copy as many lines as you like into the buffer, then use 'CTRL-U' to paste those lines. It's a little unintuitive in the NANO help, because for 'CTRL-U' it says 'uncut the line' which to some people actually means undo the last operation. I would prefer if the manual said 'PASTE the line'.

In summary:

'ALT-6' to copy a line (copy as many lines as you like, and they will be pasted in the order you copied them)

'CTRL-U' to paste the lines

Happy Nano-ing!
 
2 members found this post helpful.
  


Reply


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
How to copy not cut in the nano text editor jxrod2000 Linux - Software 16 06-05-2011 05:21 AM
How to copy-paste on command line? jameshao Linux - General 3 02-02-2009 02:14 AM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 12:28 PM
How do you copy and paste a line in VI? Thaidog Linux - General 3 05-08-2005 06:46 AM
Copy Paste under command line? Stingreen Linux - General 7 02-10-2002 07:46 PM


All times are GMT -5. The time now is 04:26 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration