How to create a desktop shortcut that launches Cygwin and tails a particular 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:
- Start cygwin
- cd dev/server/logs
- 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.
精彩评论