Jump to end of line in nano command

12.8k views Asked by At

I have an alias, that opens a file for me and jumps to a specific line in that file.

The first thing I do is ctrl+E to jump to the end of the line, but I was wondering if I can automate that as well?

This is the current alias:

alias changeCust='ssh -t [email protected] "nano +33 /etc/apache2/sites-enabled/25-av_portal.conf && service apache2 reload"'

2

There are 2 answers

0
delboy1978uk On

You can open nano at line X column Y by calling nano like so:

nano +3,5 yourFile

This will open your file and place the cursor on line 3 column 5.

Not that on an Apple Mac, only the line number works, so adding ,5 will do nothing, you can only say

nano +3 yourFile
0
Dirk Schumacher On

Only answering Jump to end of line in nano command is

CTRL + e

I do know, that this does not correctly answer the asked question. - But I was looking for the heading's question and this entry was the one found by google in the first place for me. And the CTRL + e is not good recognizable in the posted question for my fast eye-brain-learn-detection-mechanism.

fyi: CTRL + a jumps to the beginning. I found it here.