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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-25-2007, 12:27 PM
|
#1
|
LQ Newbie
Registered: Jan 2007
Posts: 3
Rep:
|
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.
|
04-25-2007, 12:31 PM
|
#2
|
LQ Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019
Rep: 
|
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 01:12 PM.
|
|
1 members found this post helpful.
|
04-25-2007, 01:05 PM
|
#3
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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....
|
|
|
12-08-2008, 02:34 PM
|
#4
|
LQ Newbie
Registered: Dec 2008
Posts: 1
Rep:
|
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 02:35 PM.
|
|
4 members found this post helpful.
|
08-25-2009, 05:35 PM
|
#5
|
LQ Newbie
Registered: Apr 2006
Posts: 3
Rep:
|
Select - Copy - Paste
Select: ALT + M + A
Copy: ALT + 6
Paste: CTRL + U
Quote:
Originally Posted by Rotten
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!
|
|
|
4 members found this post helpful.
|
01-03-2016, 11:16 AM
|
#6
|
LQ Newbie
Registered: Jan 2016
Posts: 2
Rep: 
|
thankss!!!
Thank u very much man!! it help me a lot!! blessings!! 
|
|
|
01-03-2016, 11:17 AM
|
#7
|
LQ Newbie
Registered: Jan 2016
Posts: 2
Rep: 
|
thanks!!
Quote:
Originally Posted by alexander_n
Select: ALT + M + A
Copy: ALT + 6
Paste: CTRL + U
|
 it help me alot!! thanks!!!
|
|
|
01-03-2016, 06:40 PM
|
#8
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
Quote:
Originally Posted by smp0219
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.
|
Nano me this
|
|
|
07-24-2018, 02:30 PM
|
#9
|
LQ Newbie
Registered: Jul 2018
Posts: 1
Rep: 
|
Replying to an old thread..
Just in case it helps someone.
may be your distro terminal shortcut works for pasting lines into the nano editor.
On ubuntu I use Ctrl+Shift+v to paste in the nano editor.
|
|
|
07-24-2018, 02:57 PM
|
#10
|
Member
Registered: Oct 2007
Location: albuquerque
Distribution: Debian, Arch, Kubuntu
Posts: 366
Rep: 
|
Here with nano (tried just now in Fluxbox, Debian Stretch), I can also simply select the text with the cursor, then use the middle mouse button to paste the selected text.
|
|
|
08-06-2019, 03:24 PM
|
#11
|
Member
Registered: Mar 2004
Location: USA
Distribution: Ubuntu
Posts: 291
Rep:
|
Quote:
Originally Posted by alexander_n
Select: ALT + M + A
Copy: ALT + 6
Paste: CTRL + U
|
Thank you that was so helpful.
|
|
|
All times are GMT -5. The time now is 03:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|