开发者

How to create a desktop shortcut that launches Cygwin and tails a particular file?

开发者 https://www.devze.com 2023-03-20 00:52 出处:网络
I would like to have a desk开发者_JAVA百科top shortcut open cygwin so that I can tail a log file.

I would like to have a desk开发者_JAVA百科top shortcut open cygwin so that I can tail a log file.

Currently I perform the following steps manually:

  1. Start cygwin
  2. cd dev/server/logs
  3. tail -f error.log

I would like to automate the three steps.


You could create a Windows shortcut to the following target...

C:\cygwin\bin\tail.exe -f "C:\Path\to\the\error.log"

...assuming that's where your tail executable is. Doing which tail in a Cygwin shell should confirm that.

That should run the binary in a cmd window. Do Ctrl-C to stop it.

EDIT: Oh, one thing I forgot... This might require "C:\cygwin\bin" in your PATH env variable.


Is there a specific reason to perform the tail operation from cygwin shell? If not, you can use the tail for windows and create a shortcut that will point to tail.exe -f error.log

If for some reason, you require cygwin shell, try Andy's approach, that should work for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消