Learn Exchange the Guru way !!!


Search for specifc words in huge log files or txt files

So you have a text/log file which is about 200MB? 800MB? 1GB? 2GB? Ok the data is in there, but how you gonna search for what you want? Now what if I have about 100 files 2GB each? Oops…

This is a must know, coz you may never know when you will need this.

To resolve: The process tried to write to a nonexistent pipe. –> Run this from Powershell and not cmd

Say I have about 300 log files named u_1000.log, u_1001.log, u_1002.log …. u_1300.log and I need to find out all entries which has the text “Ratish” in it.

  1. Open cmd/powershell
  2. Navigate to the location of the log file
  3. Type the command:

    type u*.log |find /i “word to search” >> c:tempoutput.txt


type – This is a part of the command and I am not asking you to “Type”

u*.log – You need to specify if the log file is *.log or *.txt. u*.log is the name of the log file sequence like shown above. If you specify u*.log, it will search for the keyword in all files starting with alphabet ‘u’ residing in the location specified.

“word to search” is the word you are searching in the logs. In this case Ratish

When this command is completed, you will get a txt file with the contents in the log file with the “word” you searched for.

Note: 1. At the start of the command there is a type and this should be included while running this.

2. The command prompt should be navigated to the location where the log files reside.

3. Most imp – RUN AS ADMINISTRATOR (dont ask me why… lol)

Ratish Nair
MVP Exchange
Team@ MSExchangeGuru

Keywords: Search for a text in a txt file, search huge text file, search huge log files, query huge logfiles, search for a name in a txt file, searching text files, parsing txt or log files

10 Responses to “Search for specifc words in huge log files or txt files”

  1. Ethan J Says:

    Man – You are awesome. Im working with Windows for a long time and nvr knew this.
    Thank you a lot.

  2. Neeraj Says:

    Think this will work just as well (without the “type” command in there)

    find “corrupt” /i log.* >> corrupt.txt

  3. Ratish Sekhar Says:

    See, we learn something new everyday… Thanks Neeraj.

  4. Muthu Says:


    can we search the messages in the Log files ( exchange log files) insted of GUI.


  5. Ryan Says:

    Nice tip dude.

  6. Mahesh Says:


    I seen most of your articles and now am forced to say ” You are amazing”

    Thanks a lot

  7. K Says:

    I…like it. Had problem with double quotes, so may have to type out @ prompt, but excellent tip!

  8. david Says:

    it worked perfectly. Is there a way to make it look for more than one word

  9. Prabhat Nigam Says:

    That will be a phrase. It has to be together.

  10. david Says:

    Also does this grab the line of text attached to what you search for if you are looking in a text file

Leave a Reply




Do NOT follow this link or you will be banned from the site!