Tag Archives: text editor

Ubuntu Server: Nano: Go to End of the File Tips, Tricks and Tutorials 19 MAY 2014

I use GNU nano as my default text editor when working on my Ubuntu Server installs, primarily for its relative ease of use (well, at least compared to VIM that is). I often encounter files (particularly log files) which contain a ridiculous number of lines and so it is useful to know how to jump straight to the end of the file, hence this note to myself here.

The shortcut to jump to the bottom of the file is:

'Ctrl' + '-' ...followed by 'Ctrl' + 'v'

So the press sequence is first Ctrl then Hyphen/Underscore and when prompted to “enter line number, column number”, follow with a Ctrl and ‘v’.

Interestingly enough, to achieve the opposite of this, in other words jump to the top of the file, substitute the [Ctrl + v] for [Ctrl + y]:

'Ctrl' + '-' ...followed by 'Ctrl' + 'y'

And that is all there is to it – quick and easy!

ubuntu linux nano editor screenshot

Related Link: GNU nano

Ubuntu: How to Copy a Line in Nano CodeUnit 06 FEB 2011

Nano is an extremely handy and lightweight text editor that comes with most Linux distributions these days. Today’s tip will teach us how to copy and paste a line or piece of text within a text document.

The first method to copy and paste a line of text is to make imaginative use of the existing ctrl+k cut text and ctrl+u uncut text command. Basically you use ctrl+k once to cut the whole line of text you wish to copy, then use ctrl+u to place it back in the place you cut it from and then move the cursor to where you want the text to appear and press ctrl+u once again.

The second method is to make use of the alt+6 key combination to copy the current line into the buffer. Again, the ctrl+u keypress will paste the buffer content’s back into the document. This can be combined with the alt+m+a key combination which first enables mouse support for nano, then allows you to set a mark to indicate the end of the text you wish to copy. Once the mark has been set, alt+6 will copy it and crl+u will paste it.

And now you know. Nifty.