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.