MacOS – way to have something similar to Cygwin on Mac

macosprintingterminal

I'm a web developer using a MacBook Pro running OS X 10.9.3.

Before I started developing in a Mac, I used Cygwin on a Windows machine to see what was happening behind the scene on my web application. I had a Logging system built in PHP which created log files with all the content of the variables I wanted to debug.

Basically, this Logging system creates another PHP file with all the debug needed and through Cygwin, every time I refreshed my web application in the browser it would refresh itself synchronously and outputted a new print with all my recent code updates.

I've searched everywhere but didn't find any close solution.
The one I'm using right now is using the terminal and writhing:

cat /Applications/MAMP/htdocs/BO_V2/data/logs/log-2014-07-10.php 

But it is not automatic and I have to press +enter every time I want to see what the log file has to show.

On OS X, is there a way to have Terminal or another application refresh the print from my log file every time I refresh my browser window (Chrome, Firefox or Safari)?

Best Answer

  • On windows, the Cygwin is a Unix-like environment.
  • OS X (now macOS) is full on UNIX, so there is no need for any additions to get these unix tools.

Open Terminal.app and start with manual pages.

The more and tail -f commands are typical unix commands to page, search, and watch a log file.

For your example, the tail command to watch your log file is:

tail -f /Applications/MAMP/htdocs/BO_V2/data/logs/log-2014-07-10.php