Visit Our UNIX and Linux User Community


VI editior line numbers


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers VI editior line numbers
# 1  
Old 09-05-2014
VI editior line numbers

Hello All,

I am very sure this a dumb question to many, but from my view its worth asking.

When I do a vi on a file, on the right bottom side I am seeing something like below:
Code:
27,16-24       7%

which tells me that I am on line 27 (which is the first number before the comma, i would like to know what are the numbers after comma in this case (16-24) denote ? the last percent number is the amount of file I have viewed, I think.
can any one tell me what that middle numbers with a dash in between denote.

Thanks

Last edited by babyPen1985; 09-05-2014 at 01:14 PM.. Reason: typed the side wrong
# 2  
Old 09-05-2014
Hi BabyPen1985,

Please refer the following link for same.

Using vi, the Unix Visual Editor


Thanks,
R. Singh
# 3  
Old 09-05-2014
Quote:
Originally Posted by babyPen1985
When I do a vi on a file,
What you show seems not to be a plain "vi", because it wouldn't have such a display. You probably mean "vim", which is a popular (but not really compatible) vi-look-alike mostly used in Linux-systems.

Could you please clarify what exactly system you are on and which vi (-clone) you are using? To find this out you can (among others) use the following commands:

Code:
which vi
ls -l $(whence vi)
ls -l $(which vi) # alternatively
ls -l $(whereis vi) # alternatively

uname -a   # to find out which OS/which system

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 4  
Old 09-05-2014
Quote:
Originally Posted by RavinderSingh13
Hi BabyPen1985,

Please refer the following link for same.

Using vi, the Unix Visual Editor


Thanks,
R. Singh
Could you please indicate where on that page the OP can find an answer to his question?
# 5  
Old 09-05-2014
Hi,

It is vim, not sure which version - there is a description of the display here.

Regards

Dave
# 6  
Old 09-05-2014
Quote:
Originally Posted by bakunin
What you show seems not to be a plain "vi", because it wouldn't have such a display. You probably mean "vim", which is a popular (but not really compatible) vi-look-alike mostly used in Linux-systems.

Could you please clarify what exactly system you are on and which vi (-clone) you are using? To find this out you can (among others) use the following commands:

Code:
which vi
ls -l $(whence vi)
ls -l $(which vi) # alternatively
ls -l $(whereis vi) # alternatively

uname -a   # to find out which OS/which system

I hope this helps.

bakunin
Thanks Bakunin, here is the information you have asked for:


system:
Code:
  uname -a
Linux x86_64 x86_64 x86_64 GNU/Linux

From:
Code:
less /etc/redhat\-release
Red Hat Enterprise Linux Server release 5.6 (Tikanga)

VI version:
Code:
vi --version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Aug  4 2010 07:21:08)

which vi --> vi=vim
Code:
ls -l $(whereis vi)
ls: vi:: No such file or directory
-rwxr-xr-x 1 root root 632880 Aug  4  2010  /bin/vi
-rw-r--r-- 1 root root  32659 Jul 23  2010      /usr/share/man/man1p/vi.1p.gz
lrwxrwxrwx 1 root root      8 May 10  2012  /usr/share/man/man1/vi.1.gz -> vim.1.gz

---------- Post updated at 11:31 AM ---------- Previous update was at 11:11 AM ----------

Quote:
Originally Posted by gull04
Hi,

It is vim, not sure which version - there is a description of the display here.

Regards

Dave
Thanks for the link Dave, but I was still not able to find the exactly what it denotes. The link concentrates on how to enable the line number, which in my case is already on.
By exploring a little more it
Code:
12,4-8         3%

line 12
4 is indicating the 4 character need to know what 8 is
a sample record from my file:

Code:
999     050     Primary Unit

the above [4-8] comes when my cursur is right in front of '*050' when i move the cursor over on to 0 it will become [5-9] and when move it over on 5 it will become [6-10] so on an so forth.

hope this helps to understand what it is, its definitely not the width of the column.

Last edited by rbatte1; 09-08-2014 at 10:57 AM.. Reason: Added CODE tags to the many already included
# 7  
Old 09-05-2014
Posted by Scrutinizer :
Quote:
Quote:
Originally Posted by RavinderSingh13 Image
Hi BabyPen1985,

Please refer the following link for same.

Using vi, the Unix Visual Editor


Thanks,
R. Singh

Could you please indicate where on that page the OP can find an answer to his question?
Hello Scrutinizer,

I agree that link will not give the complete solution to the user but if user can go through the link properly he will find many options related to vi and it may clear user's some of the queries too. I am Sorry if I have broken a forum rule here.

Thanks,
R. Singh
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #223
Difficulty: Easy
In September 2019, according to NetMarketShare, Windows had just over 87% of the global desktop market, followed by Mac OS at close to 10%, and Linux in third place at around 2%.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Grep for a line containing only 5 numbers

How would you grep for a line containing only 5 numbers? Something like this. 10 2 12 1 13 (4 Replies)
Discussion started by: cokedude
4 Replies

2. UNIX for Dummies Questions & Answers

coming out from vi editior

Hi Folks, I have opened a log file through Vi editor in putty itself and I was searching for a pattern in logs , let say 'ABCD' /abcd then I want to come out from vi editor, Please advise what is the command to come out from unix editor..! (1 Reply)
Discussion started by: KAREENA18
1 Replies

3. Shell Programming and Scripting

Assign Line Numbers to each line of the file

Hi! I'm trying to assign line numbers to each line of the file for example consider the following.. The contents of the input file are hello how are you? I'm fine. How about you? I'm trying to get the following output.. 1 hello how are you? 2 I'm fine. 3 How about you? ... (8 Replies)
Discussion started by: abk07
8 Replies

4. UNIX for Dummies Questions & Answers

grep to get line numbers

I know if i use grep -n that the output will have the lines numbered but is there a way to grep the actually line number. so like this grep -n "one" /usr/dict/numbers 1:one 21:twenty-one 31:thirty-one 41:forty-one 51:fifty-one 61:sixty-one 71:seventy-one 81:eighty-one 91:ninety-one ... (1 Reply)
Discussion started by: alindner
1 Replies

5. Shell Programming and Scripting

How to get evenly Line numbers?

hi there , i m new to unix , i d like to ask how can a get only even numbered lines matches with the word i search from txt file for example : 3461:1.D. The copyright laws of the place where you are located also govern 3471:1.E. Unless you have removed all references to Project... (17 Replies)
Discussion started by: brhn
17 Replies

6. Shell Programming and Scripting

More with line numbers

Hi All, How to get line numbers when we more on a file in LINUX thanks firestar (1 Reply)
Discussion started by: firestar
1 Replies

7. Shell Programming and Scripting

Removing Line numbers

Hi all, I have a file consisting of lines in such a format: separated by space and M1 EOS for fullstop (.) ] e.g M1 I M1 have M1 a M1 file M1 consisting M1 of M1 lines M1 in M1 such M1 a M1 format M1 EOS M2 This M2 is M3 an (4 Replies)
Discussion started by: my_Perl
4 Replies

8. UNIX for Advanced & Expert Users

Add line numbers to end of each line

Hi i would like to add line numbers to end of each line in a file. I am able to do it in the front of each line using sed, but not able to add at the end of the file. Can anyone suggest The following code adds line number to start of each line sed = filename | sed 'N;s/\n/\t/' how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies

9. Shell Programming and Scripting

add line numbers

Hello.. I have got one file ... I want to add line numbers with space form starting to ending.. for example...if the file is -------------------------- sand sorcd 2345 345 recds 234 234 5687 yeres 568 988 erfg4 67 -------------------------- I need the output ... (4 Replies)
Discussion started by: esham
4 Replies

10. UNIX for Dummies Questions & Answers

Printing line numbers

Maybe this question is out there, but I searched and didnt see it. To print my files I use more filename | lpr -Pprinter I would like to print my scripts with line numbers. How do I do this? (2 Replies)
Discussion started by: MizzGail
2 Replies

Featured Tech Videos