Nano is the command-line text editor of choice for many Ubuntu users, partially because its basic functions are quite intuitive to use. Even so, there are a few things that trick new users up. One, as we've already covered, is how to exit nano, but the second is deleting a line in nano. This very quick guide will get you up to speed.

Deleting a line in nano

Though it makes copious use of hotkeys, deleting a line in nano isn't that difficult. All you need to is:

  1. Press CTRL + Shift + 6 with your cursor at the start of your line

2. Move the cursor to the end of the line using the arrow keys

3. Press Ctrl + K to cut the text and therefore delete the line in nano

That's it. You can now delete the extra line if you wish, or use the selection shortcut to delete other parts of your document.