Reputation: 1701
My Date Stamp in Catalina.out log file is based on format "Feb 12, 2014 1:00:53 PM", i wanted to search exception occurred on the specified time, how can i find that in Vi editor??? my log files are very large containing size in GB's.
Upvotes: 0
Views: 8455
Reputation: 18042
to search in vim use the /
command - type /Feb 12, 2014 1:00:53 PM
and hit enter - all matches should get highlighted. Use n
to move to the next occurrence and N
to move to the previous occurrence.
edit:
Putting \
in front of a character will escape it so it can be used in your search - if you were trying to search and replace "http://" with "https://" you could search like :s/http:\/\//https\/\//gi
- which would keep the /
's from ending your regex statement - alternatively you can use a different character to avoid the picket fences (\/\//\/\
) like :s#http://#https://#gi
Upvotes: 2
Reputation: 1701
i found a way and it worked, hope fully it will help others.
in my case vi simple search recognized space and , and - issue is only with : or / so to search Feb 12, 2014 1:00:53 PM use /Feb 12, 2014 1\:00\:53 PM
before writing : or / in search just type \ before it.
Upvotes: 1