Delete total line in nano?

You can use Ctrl+K to delete a line.

But strictly speaking Ctrl+k does not delete lines permanently. The most recent set of deletions are stored in a buffer. These lines may be re-inserted at the current cursor location using Ctrl+U. You can use this to cut and paste.

Here you can find some useful shortcuts of nano


It's true that man nano is quite brief. However, if you have a "default" nano, you should see a small help menu at the bottom of the screen like this:

nano help

If you don't see such a menu, it is possible that you need to go into /etc/nanorc and look for something like this:

## Don't display the helpful shortcut lists at the bottom of the screen.
# set nohelp

Uncommenting the second line causes the menu to be hidden. You may prefer to copy /etc/nanorc to your home folder as .nanorc and edit that copy for user-specific modifications.

You can also access nano's built-in help (and shortcuts) by pressing Ctrl+G at any time.