Nano in Ubuntu Server – Copy/Paste

Nano in Ubuntu Server - Copy/Paste

Posted:  February 20, 2013

Nano in Ubuntu Server - Copy/Paste

Since I forget about this all the time, and continually have to look it up, I thought I would post this priceless resource.   Here is how to Copy/Paste while in a Ubuntu Server Shell (or command), while using the text editor ‘Nano’

Use the Alt-6 key combination to copy text to the “cut buffer”. Similarly, use the Ctrl-K key combination to delete text (it is cut to the “cut buffer”). If no text is marked, these two commands copy or cut the entire line of text.

Use the Ctrl-U key combination to paste the text in the “cut buffer” into the file.

To cut or copy specific text, you must first mark the start and end points of the text you want to select. You can do this with the either keyboard or the mouse, but to use the mouse for marking you must first turn on nano’s built-in mouse services.

To use the keyboard to select text, move the cursor to the start of the text you want to select, press the Alt-A key combination to mark the start, then move the cursor to the end of the section you want to select.

To use the mouse to mark the start of a selection, first make sure that nano’s built-in mouse services are turned on. Use the Alt-M key combination to toggle between nano’s mouse and the terminal’s mouse. Click on the location where you want to mark the start of the selection, move to the end of the section you want to select, and click the mouse again. You might need to use the keyboard to scroll the screen up or down because nano does not support scrolling with the mouse.

Once you have marked the beginning and end of text, the Alt-6 and Ctrl-K key combinations can be used to copy or cut it, respectively.

Kevin Pirnie

20+ Years of PC and server maintenance & over 15+ years of web development/design experience; you can rest assured that I take every measure possible to ensure your computers are running to their peak potentials. I treat them as if they were mine, and I am quite a stickler about keeping my machines up to date and optimized to run as well as they can.