LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Long time to search in 6 GB file using vim editor (https://www.linuxquestions.org/questions/linux-enterprise-47/long-time-to-search-in-6-gb-file-using-vim-editor-4175512954/)

RHCE_ran 08-01-2014 04:29 AM

Long time to search in 6 GB file using vim editor
 
We have RHEL 5.x in our production setup. There is a 6 GB file which I want to inspect to find a certain string but it is not able to find the string as the vim seems to be hanging for more than 1 hr. Please advice how this searching of a string in a big file can be done. I copied the file into a windows system but Microsoft Wordpad or Microsoft Word is failing to open the file. Or, if there is a tool to open large files in Windows as an alternate would also help.

I hope my query is clear that how to search a string in a big file using vim editor.

Please revert with the reply to my query.

Regards

Firerat 08-01-2014 04:58 AM

The simplest tool for what you describe is grep

grep has many options, worth reading its manpage

but simply
Code:

grep "Your String" /path/to/file
6gb is a large file, it is going to take some time

is it a log?

https://access.redhat.com/documentat...-locating.html

that is for rhel 6, hunt for specifics on 5 if required


All times are GMT -5. The time now is 06:57 PM.