MacOS – OS X El Capitan Auto Tail Log files

logsmacostail

So i know i can manually tail files using

tail -f filename.log

Question

I would just like to double click any .log files and have them open with Terminal using tail -f

Backgrounds

i am a long time windows users, and i have always used baretail but this is my work MAC so i can't just install or download any software would love to use just out of box tricks

Edits
Not launching from console but more of like i open the .log and they can open in Terminal itself and then i don't mind just leaving that Terminal or multiple Terminals while i am viewing them

Best Answer

There isn't an easy way to change the opener of the files and inject tail.

However, you could make very simple shell scripts and have them open the appropriate commands at log in time:

Also, you can set up several windows and several tabs with different font, color, arrangement (even across multiple Mission Control desktop spaces) and then have terminal open the group. Terminal's help has some tips on both AppleScript automation and using Window Groups (export/import) is possible to edit the xml configuration files for advanced cases.

For me, I just define aliases that are easy to type in my . initialization scripts.

alias tf=`tail -F`
alias tailf='tail -F /var/log/system.log`
alias upd=`tail -F /var/log/install.log`
alias mas=`tail -F /var/log/commerce.log`

So you can tf an arbitrary file or easily kick off specific files of interest rather than scripting a file to run a specific command. It really depends if your brain likes to bring a new window to an existing file or a new file to an existing window.