In our day to day life, we need to debug various issues with the help of several log files e.g. application logs, server access logs, error logs etc. and during this process we try to fetch relevant information from the log file(s).
While working on windows with such files, we use various editors like Notepad++, JujuEdit etc. But, what if the log files are really big, somewhere in GB’s…? Most of these editors get hanged while opening or they simply refuse to open such big files because these editors support files up to 2 GB.
For such requirements there are few editors like EmEditor, Glogg etc. which can open big files easily. These editors are really good and very fast for big files.
But here clicks a good question - “Can we execute 'grep' like Unix command(s) on such big files in our Windows command prompt...?” It would be great if we can get such luxury on windows as well.
Fortunately it’s a “Big YES”. There are several open source software’s which can be used to get most of the Unix Commands running on Windows machine in our familiar Windows command prompt. Few such software's are- UnxUtils, Cygwin etc.
I have been using UnxUtils for a long time now on my Windows machine. It’s a lightweight alternative among similar software’s. Getting started with UnxUtils is pretty simple and easy.
Let’s jump directly on the steps to get UnxUtils working on Windows machine:
- Download UnxUtils.zip.
- Extract the downloaded zip at some location on your windows machine. On my machine I kept it at “D:\Softwares\UnxUtils”
- In the PATH environment variable set the path of utility till “wbin” directory. On my machine I set the PATH variable as “D:\Softwares\UnxUtils\usr\local\wbin”
- Before moving ahead, verify the PATH setting for “wbin” directory.
It's all set… J
Now, we can to use Unix commands in our Windows command prompt. Let’s quickly check the “grep” command help in Windows Command Prompt:
Hope this article helped. Happy learning!