Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-12-2012
Registered User
 
Join Date: May 2012
Posts: 16
Thanks: 4
Thanked 0 Times in 0 Posts
Error Get line numbers while searching the pattern in log

Hi Folks,
I am searching for a pattern in logs through putty by opening the file in vi editor
and reaching to the last of the file by
Code:
$

and then searching the pattern , lets say I have to search the pattern abc then it would be
Code:
?abc

Now I want line numbers along with the matching pattern to be get in vi itself then what would be the command to get line numbers along..!Please advise
Sponsored Links
    #2  
Old 06-12-2012
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
 
Join Date: Dec 2007
Location: Out running a Marathon.
Posts: 2,189
Thanks: 46
Thanked 126 Times in 118 Posts
Take a look at this posting, as it talks about various settings in vi.
http://www.unix.com/unix-dummies-que...vi-editor.html
Sponsored Links
    #3  
Old 06-16-2012
Registered User
 
Join Date: May 2012
Posts: 16
Thanks: 4
Thanked 0 Times in 0 Posts
Hi folks,
Please advise for the command.
    #4  
Old 06-16-2012
bartus11's Avatar
Registered User
 
Join Date: Apr 2009
Posts: 3,139
Thanks: 3
Thanked 954 Times in 933 Posts

Code:
:set number

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to display the line number of file while searching for a pattern arukuku Shell Programming and Scripting 6 02-06-2012 07:38 PM
Place digit in front of the line searching pattern using sed command krbala1985 Shell Programming and Scripting 9 04-15-2011 03:07 PM
grep a pattern with line numbers. abinash Shell Programming and Scripting 8 02-23-2011 03:18 AM
Searching a pattern in file and deleting th ewhole line containing the pattern Shazin Shell Programming and Scripting 1 07-24-2009 11:27 AM
Searching for data on a specific line numbers rkumar28 Shell Programming and Scripting 8 06-18-2005 12:34 AM



All times are GMT -4. The time now is 08:39 PM.