Monthly Archives: August 2015

Searching for file containing keyword in Linux

Grep suits the bill for all my requirement for efficient search of files containing text in Linux and Mac. The following commands detail the use cases of grep.

Search for pattern
grep -rnw 'folder' -e 'text'

-r stands for recursive.
-n is the line number.
-w stands for whole word match.

Example: grep -rnw . -e 'import'
This searches for the the text ‘import’ in the current directory recursively.

Found this tip at stackoverflow.com.

Debugging HTTP Traffic in Mac

I use Fiddler extensively in Windows for debugging any HTTP traffic in my web applications. However on Mac Fiddler is not available. On some search I have found out the following tools which can do the job:

Chrome
In Chrome just type “chrome://net-internals/#http2” in the address bar and you will be able to see all the HTTP traffic that is going on in your system. Not sure when it got added to Chrome but it is a very simple yet powerful utility.

Charles Proxy
This is Java based commercial utility which can be used for almost Fiddler like functionality. This works in Windows, Linux and Mac so it is good deal I think for any developer.

Update: On using Charles Proxy I found it to be dead simple to use and it fulfilled all the requirements I had on my Mac. There is 30 minute lockout feature for unlicensed version which seems fair. It is completely worth the 50$ price tag.