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. |
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. |
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.... |
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! |
Select - Copy - Paste
Select: ALT + M + A
Copy: ALT + 6 Paste: CTRL + U Quote:
|
thankss!!!
Thank u very much man!! it help me a lot!! blessings!! :D
|
thanks!!
Quote:
|
Quote:
|
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. |
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.
|
Quote:
|
All times are GMT -5. The time now is 08:38 AM. |