LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 12-07-2010, 12:53 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 578

Rep: Reputation: 31
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
 
Old 12-07-2010, 12:57 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
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
 
Old 12-07-2010, 01:20 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 578

Original Poster
Rep: Reputation: 31
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 ?
 
Old 12-07-2010, 01:32 AM   #4
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 200

Rep: Reputation: 30
Code:
gg
to go to the beginning of the file.
 
Old 12-07-2010, 01:40 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Quote:
Originally Posted by chickenjoy View Post
Code:
gg
to go to the beginning of the file.
Or 1G
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
move cursor with keyboard in GNOME sumeet inani Linux - Newbie 1 04-18-2009 11:54 AM
Cursor editor? krock923 Linux - Software 11 08-11-2007 02:58 AM
move cursor to default button? vzzt! Linux - Newbie 6 10-05-2004 07:14 PM
My cursor doesnt move Fiery Mandriva 13 04-13-2004 07:18 PM
mouse cursor doesn't move in X/Debian LovelyJunna Linux - Newbie 7 03-26-2004 06:12 PM


All times are GMT -5. The time now is 02:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration