Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jump to line X in nano editor

Tags:

nano

People also ask

How do you go to line in nano editor?

You can ask nano to temporarily turn on line numbers by pressing Alt-C (meaning “Hold down the Alt key and the C key simultaneously”). This will show line and column numbers near the bottom of nano's window.

How do you get to the last line in nano editor?

Once your file is opened in the nano editor, press “Ctrl+ W”.

How do I exit nano without Ctrl X?

To quit nano, you will just press F2 or Ctrl + X keys. You will be asked to press 'y' to save the current file, or in case of without saving you will press n to exit from nano.

How do I get to line in Ubuntu?

To do this, press Esc , type the line number, and then press Shift-g .


In the nano editor

Ctrl+_

On opening a file

nano +10 file.txt

The shortcut is: CTRL+shift+- ("shift+-" results in "_")

After typing the shortcut, nano will let you to enter the line you wanna jump to, type in the line number, then press ENTR.


The shortcut is: CTRL+_

Have a look here http://ubuntuforums.org/showthread.php?t=1005737


I am using nano editor in a Raspberry Pi with Italian OS language and Italian keyboard. Don't know the exact reason, but in this environment the shortcut is:

Ctrl+-


According to section 2.2 of the manual, you can use the Escape key pressed twice in place of the CTRL key. This allowed me to use Nano's key combination for GO TO LINE when running Nano on a Jupyter/ JupyterHub and accessing through my browser. The normal key combination was getting 'swallowed' as the manual warns about can more often happen with the ALT key on some systems, and which can be replaced by one press of the ESCAPE key.
So for jump to line it was ESCAPE pressed twice, followed by shift key + dash key.


I am using Linux raspi 4.19.118+ #1311 via ssh Powershell on Win 10 Pro 1909 with German keyboard. nano shortcut Goto Line with "Crtl + Shift + -" was not working Solution: Step 1 - Do Current Position with "Crtl + C" Step 2 - Goto Line with "Crtl + Shift + -" IS working!

I dont know what effects it. But now its working without step 1!