LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to copy/paste a line in nano editor (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-copy-paste-a-line-in-nano-editor-548925/)

smp0219 04-25-2007 12:27 PM

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.

jay73 04-25-2007 12:31 PM

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.

pixellany 04-25-2007 01:05 PM

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....

Rotten 12-08-2008 02:34 PM

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!

alexander_n 08-25-2009 05:35 PM

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


Quote:

Originally Posted by Rotten (Post 3368399)
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!


gardo984 01-03-2016 11:16 AM

thankss!!!
 
Thank u very much man!! it help me a lot!! blessings!! :D

gardo984 01-03-2016 11:17 AM

thanks!!
 
Quote:

Originally Posted by alexander_n (Post 3657386)
Select: ALT + M + A
Copy: ALT + 6
Paste: CTRL + U

:D it help me alot!! thanks!!!

BW-userx 01-03-2016 06:40 PM

Quote:

Originally Posted by smp0219 (Post 2724971)
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

rojinmroy 07-24-2018 02:30 PM

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.

m.a.l.'s pa 07-24-2018 02:57 PM

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.

xbaez 08-06-2019 03:24 PM

Quote:

Originally Posted by alexander_n (Post 3657386)
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 08:38 AM.