LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Vi editor How to move cursor to a specified line number. (http://www.linuxquestions.org/questions/linux-newbie-8/vi-editor-how-to-move-cursor-to-a-specified-line-number-848784/)

gardenair 12-07-2010 12:53 AM

Vi editor How to move cursor to a specified line number.
 
Hi,
Iam using Vi editor for editing and configuring my file.I am facing a little problem when there is long file like 3000 lines. Normally i use
Code:

:set number
in vi editor to visible my line number.The problem is when i have to go in the top of the file like say line number one I use k for it and to move down I use j which is too much time consuming.
How can i jump directly my cursor to line number 2333 or line number 2600.
I am tired to use j and k ever time. please help me
thanks
mypass

chrism01 12-07-2010 12:57 AM

Code:

:2333
just specify the line num you want. ctrl-g tells you current line num.
shift-g to go to end-of-file
Code:

:1
1st line :)

gardenair 12-07-2010 01:20 AM

well as you mentioned that
Code:

shift-g to go to end-of-file
it really help me but if I again want to go beginning of the file then is their any hot key for it ?

chickenjoy 12-07-2010 01:32 AM

Code:

gg
to go to the beginning of the file.

catkin 12-07-2010 01:40 AM

Quote:

Originally Posted by chickenjoy (Post 4183134)
Code:

gg
to go to the beginning of the file.

Or 1G


All times are GMT -5. The time now is 01:05 PM.