Operating System - Linux
1753835 Members
8204 Online
108806 Solutions
New Discussion юеВ

Search in file, of the end to the beginning

 
SOLVED
Go to solution
hboo
Frequent Advisor

Search in file, of the end to the beginning

Hello all!!

I want to know of that way I can seek in a file of text from the end of the file up to the beginning to initiate, this is in vi

I want to execute a search from the end of a file using vi

Thanks...
;)
Hayse
5 REPLIES 5
Christian Tremblay
Trusted Contributor
Solution

Re: Search in file, of the end to the beginning

to search backwards from the bottom of the file use: ?

to search forward use: /

Chris
Sandman!
Honored Contributor

Re: Search in file, of the end to the beginning

For reverse search in vi(1) switch to command mode and issue the command:

?string_to_search
spex
Honored Contributor

Re: Search in file, of the end to the beginning

Hi Hayse,

'G' to go to the end of the file. Then enter '?' and "Return". 'n' will repeat the search in reverse (and 'N' will repeat in the forward direction).

PCS
hboo
Frequent Advisor

Re: Search in file, of the end to the beginning

Perfect Thank's all of you
hboo
Frequent Advisor

Re: Search in file, of the end to the beginning

Thank's again.
:)
Hayse